Just another Perl shrine | |
PerlMonks |
Re: Using subroutine between scriptsby asarih (Hermit) |
on Nov 07, 2003 at 16:22 UTC ( [id://305345]=note: print w/replies, xml ) | Need Help?? |
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.
In Section
Seekers of Perl Wisdom
|
|