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

I am currently working on a Unix box with Perl installed, but I do not have administrator rights to the Perl installation.

There are a few CPAN modules which would be extremely useful, and I would like to install them. tachyon's excellent tutorial: A Guide to Installing Modules explains how to use

$ perl Makefile.PL LIB=~/lib
Now, I want to add ~/lib to @INC for everything I run. Can I do this by means of an environment variable, e.g. putting into .profile something like:
export LIBPATH="$LIBPATH;~/lib"
If this is not doable, I suppose I could alias perl to be perl -I~/lib (messy).

Also, failing this, how do I tell Makefile.PL to add a library to @LIB? This would be handy when I am installing multiple modules locally when they have depndencies.

Any help would be appreciated.

Replies are listed 'Best First'.
Re: Personalised @LIB search path
by broquaint (Abbot) on May 21, 2002 at 12:43 UTC
    I recall the PERL5LIB environment variable is handy in these situations
    shell> export PERL5LIB="$PERL5LIB:/home/monkname/.perl" shell> perl -e 'print "@INC\n"' /home/monkname/.perl /usr/lib/perl5/site_perl/5.6.0/i386-linux/ /usr/l +ib/perl5/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i386-linux/ /usr/lib/pe +rl5/site_perl/5.6.0 /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/sit +e_perl
    You can find more info on the environment variables that perl uses in the perlrun manpage.
    HTH

    _________
    broquaint

Personalised @INC
by Joost (Canon) on May 21, 2002 at 12:43 UTC
    Use the PERL5LIB evironment variable instead of LIBPATH.

    see perldoc perlrun

    -- Joost downtime n. The period during which a system is error-free and immune from user input.