views:

67

answers:

1

On a standard linux set up, where can I add a directory to the @INC variable?

In the /etc/profile file, I added:

 export PERLLIB=$PERLLIB:/foo/bar
 export PERL5LIB=$PERL5LIB:/foo/bar

Thanks

+1  A: 

If you want every Perl script to have the additional library paths, you can re-compile Perl and specify the extra directories as part of the setup. Other than that, you're stuck with the ad hoc methods as you describe.

brian d foy
Rebuilding Perl sounds a bit of an overkill just to get an extra library in @INC
justintime
You only need to rebuild it if you want it to be there without having to do anything else. Otherwise, just use PERL5LIB.
brian d foy