Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Using subroutine between scripts

by asarih (Hermit)
on Nov 07, 2003 at 16:22 UTC ( #305345=note: print w/replies, xml ) Need Help??


in reply to Using subroutine between scripts

You should definitely put it in a module. That's what code reuse is for; when you want to tweak the subs, you only have to do it once. @INC always include ., so you can put the module file in the same directory as the scripts themselves. If your scripts exist in many directories, then you could do use lib qw[ /module/dir /more/module/dir]; to tell perl to look in the correct directory.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2022-08-17 19:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?