Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: "use lib" with low precedence?

by shahzbot (Novice)
on Oct 07, 2002 at 22:49 UTC ( [id://203524]=note: print w/replies, xml ) Need Help??


in reply to "use lib" with low precedence?

One other option, for those not wanting to modify their scripts at all: The PERL5LIB environment variable. If you do this:
perl -e "print join(qq|:|, @INC)"

you'll get your current perl @INC array in a path format. If you set your PERL5LIB env var to the output of that one-liner and also tack your own custom libs on the end of it, this will have the effect of putting a copy of your @INC in front of your custom libs, even though your original @INC remains untouched (and unused) at runtime. When I do this, my PERL5LIB ends up looking like this (breaks added for readability):
/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:.:
/home/jtillman/customlibdir/

It ends up doubling your original @INC path in memory, but as a temporary measure, it's much easier to reverse, since you have no code to modify. Just a thought... jpt

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-03-30 07:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found