Welcome to the Monastery | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
A module is loaded at compile time, no matter where you place the use Module (except in an eval STRING). A module cannot be 'unloaded', although those that specify an unimport may allow you to turn off any semantics that they export using no Module. If you want a module to be loaded only on first demand, you could require it instead. I personally prefer to put all my use statements at the top of the file (so I know which modules my code needs to run in a single glance), although others may prefer to put them in the subroutines that actually need their functions/semantics. I wasn't expecting this though:
Why isn't the third print Dumper 'correctly misinterpreted'? In reply to Re: Where and when you should place 'use module;'?
by polypompholyx
|
|