@INC is the result of all perllib additions that have been made by perl upon startup. It is not fixed at all. Although there is a portion of it that is fixed at compile time. The @INC is a combination of compile time settings, PERLLIB environment variable, perl command line -I parameters and use lib statements.
For example on linux, if you do:
PERLLIB=envbar perl -I cmdfoo -V -e "use lib ('usebaz');"
You will see the resulting @INC :
@INC:
usebaz
cmdfoo
envbar
/usr/lib/perl5/5.6.1/i386-linux
/usr/lib/perl5/5.6.1
/usr/lib/perl5/site_perl/5.6.1/i386-linux
/usr/lib/perl5/site_perl/5.6.1
/usr/lib/perl5/site_perl/5.6.0/i386-linux
/usr/lib/perl5/site_perl/5.6.0
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.6.1/i386-linux
/usr/lib/perl5/vendor_perl/5.6.1
/usr/lib/perl5/vendor_perl
.
There appears to be an order of precidence here too. use lib is first, -I option is second, PERLLIB is third and compiled settings is fourth.
Update: added use lib to the example.
Hazah! I'm Employed! But this place sucks
|