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

Re: use and require inside subs

by JediWizard (Deacon)
on Nov 02, 2004 at 23:37 UTC ( #404782=note: print w/replies, xml ) Need Help??


in reply to use and require inside subs

Personally, I avoid ever doing a require 'Something.pl'. If I have a subroutine in a script which I need to use in another script, I put it in a module and use it. The only time I use require to include code is when I need to dynamically include something at run time.

As I understand it, use is a compile time directive, and will have the same effect whether it is inside a subroutine that is called repeatedly, or at the top of the script or file.

May the Force be with you

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2020-08-09 12:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which rocket would you take to Mars?










    Results (54 votes). Check out past polls.

    Notices?