Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: Need help in dynamically loading a module

by philipbailey (Chaplain)
on Feb 15, 2012 at 08:44 UTC ( #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.

Comment on Re: Need help in dynamically loading a module
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2015-10-08 19:10 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (223 votes), past polls