The every day things from Thalamus' life.

Thalamus' Blog

22 January, 2014

local::lib and default perl5 in home folder.

Filed under: ComputerStuff_en — Thalamus @ 11:50

Please note – this guide is meant for only one local install of perl, eg. running the stock perl from the os, but keeping the perl modules private. If you are going to use eg. perlbrew, then don’t use the following ENV.

PERL5LIB=~/perl5/lib/perl5
PERL_CPANM_OPT=–local-lib=~/perl5

$ mkdir ~/perl5
$ perl –MCPAN –e shell

Manually choose a mirror close to you.

CPAN> o conf urllist unshift http://cpan.uib.no/
CPAN> o conf commit
CPAN> quit

Download local::lib – extract and run from source.

$ perl Makefile.PL –bootstrap ; make test ; make install
$ curl –k -L http://cpanmin.us | perl – App::cpanminus

If you choose to install ‘cpanm’ first, then install local::lib by using ‘cpanm’

$ ~/perl5/bin/cpanm –local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)

Now, add this to your .bash_profile

eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)

• • •