"be consistent" | |
PerlMonks |
Re: Conditional loading of module with global exportsby kcott (Archbishop) |
on Feb 22, 2016 at 21:22 UTC ( [id://1155849]=note: print w/replies, xml ) | Need Help?? |
G'day learnedbyerror, You can conditionally load modules using the if pragma. Command line options will be processed at runtime, which will be too late to affect compile-time loading of modules. However, you can modify the command line in a different way, by setting an environment variable, which will be available at compile time. Here's a minimal example (pm_1155832_cond_use_mod.pl) using List::Util:
Load module at runtime:
Load module at compile time:
— Ken
In Section
Seekers of Perl Wisdom
|
|