Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: Difference between 'use' and 'require'by Crian (Curate) |
on Dec 07, 2004 at 09:51 UTC ( [id://412869]=note: print w/replies, xml ) | Need Help?? |
The use statement works at compile time, require at run time. So if you have a module that does a lot in a begin block and you don't really need it in all cases, then it's clever to "require" it there where you want to use it but don't "use" it. So you don't have to wait for all that initializations of that module in case you don't need it. update: As I have seen now, this point was already said. But it wasn't as I startet to write my post (I was interrupted while typing).
In Section
Seekers of Perl Wisdom
|
|