Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: Basic - Perl5lib

by aquarium (Curate)
on Oct 28, 2010 at 02:23 UTC ( [id://867886]=note: print w/replies, xml ) Need Help??


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

..and typically you'd set that environment variable so that all your processes/scripts had access to that additional module directory. otherwise just add an additional module directory directly in a perl script by pushing it onto @INC in a begin section. example for modules in specified directory and/or current directory
BEGIN { $my_module_dir = '~/myperl_modules/`; push(@INC, ('.',"$my_module_dir")); } use mymodule; ...
oracle installs (and embedded) perl and it's own set of modules, and sets perl5lib. so not a good idea to modify perl5lib on oracle systems unless you really know what you're doing.
the hardest line to type correctly is: stty erase ^H

Replies are listed 'Best First'.
Re^3: Basic - Perl5lib
by dsheroh (Monsignor) on Oct 28, 2010 at 08:06 UTC
    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).
Re^3: Basic - Perl5lib
by Anonymous Monk on Oct 28, 2010 at 12:04 UTC

    Thanks for your replies. How can I set the PERL5LIB environment variable if I don't have one?

    If I do manage to find my missing PERL5LIB, is it shared by all my Perl installations?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2025-06-16 07:12 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.