2010-04-03

Perl - How to change @INC to include non-standard path

Have been playing around with local::lib and bootstrap a few directories. After switching a few local::lib directories, I tend to forget which cpan module is installed in which local::lib directory and this make perl don't know where to find the cpan module. This is how to set the environment variable @INC so that perl can quickly locate the cpan module.
export PERL5LIB=$PERL5LIB:/some/other/perl/lib/path

To make a directory precedence over the current @INC path, e.g. :
export PERL5LIB=/some/other/perl/lib/path:$PERL5LIB


Show me the path :
perl -E 'map{say}@INC'
* requires perl 5.10 and above.

Or,
perl -V

Ciao !!!

1 comment:

Shahid Siddique said...

this is not working with Quotes; I ran it perl -E map{say}@INC and it worked fine. Thank you for your help.