Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: Basic - Perl5lib

by dsheroh (Monsignor)
on Oct 28, 2010 at 08:06 UTC ( [id://867937]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Basic - Perl5lib
in thread Basic - Perl5lib

The more common way to add to @INC from within your program is with use lib. The following is equivalent to (more concise than) the code above:
use lib qw( . ~/myperl_modules/ ); use mymodule;
...except that use lib puts the extra dirs at the start of @INC (giving them precedence over system modules, which is normally what you want) while your use of push puts them at the end (giving system modules precedence, which is normally not what you want).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2025-06-16 06:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.