Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: use and require inside subs

by JediWizard (Deacon)
on Nov 02, 2004 at 23:37 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://404782]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2025-05-23 01:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.