perl / local cpan without root

Installing  perl modules on systems where you don’t have root privileges can be a real pain.  The easiest way to get it working, is what I found on stackoverflow below.

wget -O- | perl - -l ~/perl5 App::cpanminus local::lib
eval `perl -I ~/perl5/lib/perl5 -Mlocal::lib`
echo 'eval `perl -I ~/perl5/lib/perl5 -Mlocal::lib`' >> ~/.bash_profile
echo 'export MANPATH=$HOME/perl5/man:$MANPATH' >> ~/.bash_profile

Then use it like so:

cpanm Module::Name

Leave a Reply

Your email address will not be published. Required fields are marked *