Installing a CPAN Perl module from a non-root account
Problem: you do not have root permission but want to install a Perl
module in a local directory and the module can be located from your
CPAN Perl modulesRefer to Installing CPAN Modules and this section in the CPAN FAQ.
Download the Perl moduleFind the Perl module you want. Google or the CPAN Search Site are usually good ways to find the module. Download a copy of the entire package (usually a .tar.gz, not the individual .pm "Perl module" file) into a download directory. I usually keep a directory named ~/downloads.
Install the Perl module into your ~/lib directoryUnpack the CPAN Perl module:
tar -zxvf ~/downloads/Statistics-Descriptive-2.6.tar.gz
(The conventional installation method is:
But specify the installation into ~/lib/perl5 instead:
perl Makefile.PL PREFIX=~/lib/perl5
Appending installation info to /home/you/lib/perl5/5.8.2/cygwin-thread-multi-64int/perllocal.pod
Change your Perl scripts so that they can find the Perl module that you have installed locallySee this section in the CPAN FAQ.
I prefer the first method that is mentioned, which is to set the
environment variable. This is easy to do in a login script.
Remove the Perl moduleJust remove the appropriate files from
~/lib/perl5. Or use the ExtUtils package to help you remove the files.