Setup your own perl binaries and package libraries


I like putting all of the system-like directories into one directory, called local_sys, when installing things that override the system default settings. In my .bashrc or .profile file I setup the following:

# set local system
export LOC_SYS=${HOME}/local_sys

# set path
export PATH=${LOC_SYS}/bin:${LOC_SYS}/bin/x86_64:${LOC_SYS}/perl5/bin:${PATH}}

# set local ld lib
export LD_RUN_PATH=${LOC_SYS}/lib:${LD_RUN_PATH}

To install perl(s) with perlbrew; this seems to work.

install perlbrew:

git clone
cd ./perlbrew
./perlbrew init

At this point, add the following to .bashrc:

export PERLBREW_HOME=~/local_sys/.perlbrew
source ~/local_sys/perl5/perlbrew/etc/bashrc

Build a local perl:

./perlbrew install-patchperl
./perlbrew available
./perlbrew install perl-5.20.2

install cpanm:

git clone
perl Makefile.PL

install local::lib:

./cpanm local::lib
git clone
perl Makefile.PL --bootstrap=${LOC_SYS}
make test && make install

Now, add this to your .bashrc to export the environmental variables needed by local::lib.

eval $(perl -I${LOC_SYS}/perl5/lib/perl5 -Mlocal::lib=${LOC_SYS}/perl5)