Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: eval "require $class" seems wrong

by ikegami (Patriarch)
on Aug 22, 2007 at 19:20 UTC ( [id://634487]=note: print w/replies, xml ) Need Help??


in reply to Re^2: eval "require $class" seems wrong
in thread eval "require $class" seems wrong

It uses eval EXPR for #line to work. It has nothing to do with require. (eval BLOCK would suffice if you wanted to catch exceptions.)

The following will work (even if your platform doesn't use / as the path seperator):

$class = 'HTTP/Request.pm'; require $class;

However, transforming the class name into a path is really no better.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://634487]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2024-04-19 08:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found