Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Difference between 'use' and 'require'

by Crian (Chaplain)
on Dec 07, 2004 at 09:51 UTC ( #412869=note: print w/ replies, xml ) Need Help??


in reply to Difference between 'use' and 'require'

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).


Comment on Re: Difference between 'use' and 'require'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://412869]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2014-09-22 07:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (182 votes), past polls