Monday, June 6, 2011

adding values into INC perl

@INC array is actually array element the perl program will search for the perl modules in the program.


PERL5LIB="/usr/home";
export PERL5LIB:

This will add the path "/usr/home" to the first element of the @INC array.

To remove the content set by PERL5LIB simply use

unset PERL5LIB;


There is also a other way:
add this line before the use module lines

use lib "/usr/home";

This will also add the path to "/usr/home" temporarily to the INC path for this particular program.

No comments:

Post a Comment