Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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

by ikegami (Pope)
on Aug 22, 2007 at 19:20 UTC ( #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
Node Status?
node history
Node Type: note [id://634487]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (1)
As of 2020-10-25 19:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (249 votes). Check out past polls.

    Notices?