![]() |
|
laziness, impatience, and hubris | |
PerlMonks |
Re: Using 'use' away from script startby ehdonhon (Curate) |
on Nov 15, 2001 at 08:48 UTC ( [id://125508]=note: print w/replies, xml ) | Need Help?? |
As Ovid mentioned, Perl does all the use'ing at compile time no matter where it lives in your code. As an insteresting aside, it turns out that it will even evaluate use statements prior to optimizing your code. So even if you do something like this:
Perl will still load MyModule. If you really only want to load that module whenever that function is called, then you need to require() the module instead of use'ing it.
In Section
Seekers of Perl Wisdom
|
|