|
|
|
Your skill will accomplish what the force of many cannot |
|
| PerlMonks |
Re: use module if condition is metby broquaint (Abbot) |
| on Jan 23, 2004 at 12:08 UTC ( [id://323611]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
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
Although make sure you use parens when calling a dynamically defined subroutine otherwise you'll get a compile-time error under strict 'subs'.
HTH
_________
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||