Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: Overriding the built-in require function (@INC)

by lodin (Hermit)
on Feb 06, 2008 at 22:53 UTC ( [id://666692]=note: print w/replies, xml ) Need Help??


in reply to Re: Overriding the built-in require function (@INC)
in thread Overriding the built-in require function

But this of course fails if someone happens to do

BEGIN { unshift @INC, sub { ... } } use lib 'somewhere/special'; require Net::Ping; # Resolves to "somewhere/special/Net/Ping.pm".
as lib also unshifts @INC. This accident may not be obvious if it's a module that uses lib.

For many purposes it works, but one should be aware of that it's not bullet proof against accidents.

lodin

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-26 03:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found