Install Perl module in your home directory

To install a Perl module in your home directory is helpful for a couple of reasons. 1) It doesn’t require root permission. 2) It’s installed separately from the site-wide installed modules, hence can coexist with those modules and useful when trying a module that has different version with what’s already installed.


$ perl -MCPAN -e shell PREFIX=~/lib/perl LIB=~/lib/perl
cpan> install
cpan> quit

Assuming that you want it installed on the directory lib/perl on your home directory. Also, don’t forget to set PERL5LIB:

export PERL5LIB=~/lib/perl:$PERL5LIB

1 Comment

  1. your nerd is showing 😛

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.