Linux / Unix Tips and Tricks

This blog contains Linux / Unix Tips and Tricks, collected during my work as a Unix System Administrator.
They are here for my own reference, but they might help you as well !

Perl: how to install a Perl module locally

len | 16 December, 2008 11:05

Today I wanted to install a Perl module in my home directory. Here's how to do it:

$ perl Makefile.PL PREFIX=/home/len
$ make
$ make test
$ make install

For older modules you might need to specify other variables during module installation.
I did it by saving the following variables in a file (install_vars.sh):

PREFIX=/home/len \
INSTALLPRIVLIB=/home/len/lib/perl5 \
INSTALLSCRIPT=/home/len/bin \
INSTALLSITELIB=/home/len/lib/perl5/site_perl \
INSTALLBIN=/home/len/bin \
INSTALLMAN1DIR=/home/len/lib/perl5/man \
INSTALLMAN3DIR=/home/len/lib/perl5/man/man3

Now you can use the following syntax:

$ perl Makefile.PL `cat install_vars.sh`
$ make
$ make test
$ make install

 
Accessible and Valid XHTML 1.0 Strict and CSS
Powered by LifeType - Design by BalearWeb