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

Bash Shell & Perl Library Path

by Anonymous Monk
on Jun 28, 2009 at 02:38 UTC ( [id://775407]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I've searched high & low and can't belive I haven't found the answer to this!

I use bash shell on Ubuntu and want to add the library path "/home/myname/perl_modules" permanantly

How can I do this?

Replies are listed 'Best First'.
Re: Bash Shell & Perl Library Path
by toolic (Bishop) on Jun 28, 2009 at 02:51 UTC
    I do not use bash, but you should be able to set the PERL5LIB environment variable to point to your path. Add this to your shell initialization file (~/.bashrc, I presume, to make it permanent).
      How can I set it globally for everyone?

        For Login-Shells its /etc/bash.bashrc - This is is the system-wide version of the ~/.bashrc file. Ubuntu is configured by default to execute this file whenever a user enters a shell or the desktop environment.

        See https://help.ubuntu.com/community/EnvironmentVariables for the glory details.

        Install the module as root
Re: Bash Shell & Perl Library Path
by Bloodnok (Vicar) on Jun 28, 2009 at 21:01 UTC
    If you want to add it permanently then, assuming you use sh (or a descendant thereof but not csh or any of its variants), add the following into your profile i.e. $HOME/.profile
    PERL5LIB=$PERL5LIB export PERL5LIB<new path>
    or possibly
    export PERL5LIB=$PERL5LIB
    If you want all users to inherit this setting, then add the above into /etc/profile.

    Note that the above will vary if you are unfortunate/misguided enough to use the C shell - if nothing else, the file to change will be $HOME/.login.

    Note also that you should avoid using shell specific scripts e.g. .bashrc, .kshrc or even .cshrc to set login session environment variables - these should be used merely to modify the login shell environment on a per shell basis.

    A user level that continues to overstate my experience :-))

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://775407]
Approved by toolic
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-28 13:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found