Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Need help in dynamically loading a module

by philipbailey (Curate)
on Feb 15, 2012 at 08:44 UTC ( [id://953870]=note: print w/replies, xml ) Need Help??


in reply to Need help in dynamically loading a module

use statements are run at compile time, in an implicit BEGIN block. They are run wherever they appear in your code, irrespective of whether they appear (as in your case) in conditional statements.

Instead, use require, which is evaluated only at run time. Wrap it in an eval and test $@ to check whether the require succeeded.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-03-28 08:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found