Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: Win32 @INC behavior

by osunderdog (Deacon)
on Nov 16, 2005 at 14:46 UTC ( [id://509056]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Win32 @INC behavior
in thread Win32 @INC behavior

@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

Replies are listed 'Best First'.
Re^4: Win32 @INC behavior
by richz (Beadle) on Nov 17, 2005 at 00:41 UTC
    Yeah I guess I meant fixed if not modified using environment variable, command line option, etc. The location of the perl executable seems to affect the @INC variable and I think a reply further down in this thread is a convincing reason. Thanks.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://509056]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-03-29 09:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found