Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

PERL5LIB usage ?

by vinoth.ree (Prior)
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/MyConfig.pm , 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 ?

Update

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

Comment on PERL5LIB usage ?
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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://780213]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2015-08-01 00:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (285 votes), past polls