Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: use module if condition is met

by broquaint (Abbot)
on Jan 23, 2004 at 17:08 UTC( #323611=note: print w/replies, xml ) Need Help??


in reply to use module if condition is met

For conditional a use statement, see the if module. But if you're happy to include your modules at runtime then a simple require will be be. Finally, to check for the existence of a subroutine you can simply use defined e.g
defined &mysubtocheck && mysubtocheck();
Although make sure you use parens when calling a dynamically defined subroutine otherwise you'll get a compile-time error under strict 'subs'.
HTH

_________
broquaint

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2016-08-30 03:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (410 votes). Check out past polls.