in reply to add remote dir to @INC
will not work.push(@INC, "/my/directory"); use MyModule;
should work.use lib "/my/directory"; use MyModule;
use and BEGIN are evaluated "at compile time", before any other code is executed. So, in the first example use MyModule; is evaluated before @INC has been modified. The second example works because both statements are evaluated at compile time.
The PERL5LIB environment variable is, as was suggested, also useful. It, too, is processed at compile time.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: add remote dir to @INC
by kosta (Sexton) on May 25, 2011 at 17:32 UTC | |
by kosta (Sexton) on May 25, 2011 at 17:50 UTC | |
by toolic (Bishop) on May 25, 2011 at 18:52 UTC |