in reply to using a file in a different dir
The use statement searches a module in @INC. The lib pragma adds directories to @INC. So you will likely want to tell Perl (for this script) to also look elsewhere for your code:
use lib '../foo';
If you have a directory with modules that you always want to use, you can set $ENV{PERL5LIB} (or was it $ENV{PERL5INC} ?). If you only want to alter the module search path for one invocation of your program, you can invoke it as:
perl -I../foo my_script.pl
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: using a file in a different dir
by dtr (Scribe) on Nov 01, 2005 at 10:12 UTC |