Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

PERL5LIB usage ?

by vinoth.ree (Monsignor)
on Jul 15, 2009 at 09:18 UTC ( #780213=perlquestion: print w/replies, xml ) Need Help??
vinoth.ree has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I was installing perl modules in my local directory using the PREFIX in CPAN/ , I set the path as /home/ree/General/perl/ and, I was saving the path of each installed modules in the PERL5LIB environment variable in my .bashrc file as below,

export PERL5LIB="$PERL5LIB:/home/ree/General/perl/local/share/perl/5.8.8/:/home/ree/General/perl/share/perl/5.8.8/:/home/ree/General/perl/local/lib/perl/5.8.8/:/home/General/perl/share/perl/5.8.8/" So I am adding the path in this bash file, whenever I install a perl module

Is there any other way to specify only single path in PERL5LIB , where all the perl modules gets installed ?


What I am asking that I want all the perl modules in a single directory instead of going 'local/share' or 'share/lib/'

Replies are listed 'Best First'.
Re: PERL5LIB usage ?
by ikegami (Pope) on Jul 15, 2009 at 13:52 UTC
    # In login script export PERL5LIB=~/lib/perl5 # Installing a module perl Makefile.PL PREFIX=~ LIB=~/lib/perl5 make test make install # Using the module perl -e'use My::Module'
Re: PERL5LIB usage ?
by Anonymous Monk on Jul 15, 2009 at 09:56 UTC
    Set PERL5LIB to value of PREFIX and you're done
Re: PERL5LIB usage ?
by cdarke (Prior) on Jul 15, 2009 at 11:49 UTC
    The directories in PERL5LIB are searched before the standard directories (they are placed on the front of @INC). I don't think there is a way of removing the standard libraries just using the environment variable.

    You can do more sophisticated adjustment from with perl by manipulating @INC within a BEGIN block, but that is not for the faint hearted.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://780213]
Approved by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (11)
As of 2017-02-23 21:11 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (351 votes). Check out past polls.