Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: use module if condition is met

by Abigail-II (Bishop)
on Jan 23, 2004 at 17:16 UTC ( #323618=note: print w/ replies, xml ) Need Help??


in reply to use module if condition is met

use if $type eq 'x', Some::Module;

Of course, that requires the value of $type to be known at compile time. Otherwise, do something like:

if ($type eq 'x') { require Some::Module; Some::Module -> import if Some::Module -> can ("import"); }

Abigail


Comment on Re: use module if condition is met
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2014-07-28 10:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (195 votes), past polls