Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^5: Overriding default libs

by tobyink (Abbot)
on Nov 15, 2012 at 14:24 UTC ( #1004025=note: print w/replies, xml ) Need Help??


in reply to Re^4: Overriding default libs
in thread Overriding default libs

It doesn't look any levels down. If you:

use lib "/tmp"; use Foo::Bar;

... then Perl will use "/tmp/Foo/Bar.pm", but not "/tmp/x/Foo/Bar.pm".

The exception for your CPU architecture name (in your case "x86_64-linux-thread-multi") is due to some trickery by use lib which automatically detects those directories if they exist (and look like proper locations containing architecture-specific libraries), and unshifts two entries onto @INC instead of the normal one.

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1004025]
help
Chatterbox?
[Lotus1]: belg4mit are you on a Linix server?
[belg4mit]: yes. the regular expression is generated in code from a text file. that s the regular expression that Perl blows up when it reaches it, but if I use it from the comman line it's fine
[belg4mit]: oh, wait, damn, different lne number
[choroba]: same Perl version?
[choroba]: oh, ok
[belg4mit]: I had \Q'd in one RE but not a subsequent one, doh
[talexb]: Programs writing programs. Neat stuff.

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2017-04-25 16:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (460 votes). Check out past polls.