Perl Management



This document describes how to install Perl, and Perl modules using cpan command which also installs required dependencies.

Procedure to install stable perl and stable perl modules under private user home directory on production server. Following was done on lcls-builder. Same can be done for system wide perl  under /usr/local/bin.

Step 1  Copy CPAN mirror on production under proper location.

First logon to server having access to internet and get CPAN copy.
Then copy the same on production.

On mcctest1
$ /usr/bin/rsync -av --delete     /scratch/CPAN

Copy CPAN to production in /usr/local/admin/package/CPAN

Step 2  Install Perl 5.16.3

cd ~divekar
rm  .cpan
rm  .cpanm
(note: this is needed to clean up the cache created cpan, and mke sure you
have a fresh installation)
tar  xvzf perl-5.16.3.tar.gz
cd ~divekar/perl-5.16.3
mkdir ~divekar/perl-5.16.3/bin
sh Configure -Dprefix=/home/divekar/perl-5.16.3
make test
make install

Note: this will install perl binaries in /home/divekar/perl-5.16.3, the same
area as the source.

Step 3  Check basic functionality of installed perl
export PATH=/home/divekar/perl-5.16.3/bin:$PATH
which perl
perl -v
perl ~jingchen/bin/ or instmodsh

Step 4  Configure cpan to point to local CPAN directory
Run cpan that is coming with perl.

[divekar@lcls-builder ~]$ cpan
Would you like to configure as much as possible automatically? [yes]
Would you like me to automatically choose some CPAN mirror
sites for you? (This means connecting to the Internet) [yes] no

Would you like to pick from the CPAN mirror list? [yes] no
Please enter your CPAN site: [] file:///usr/local/admin/package/CPAN
Enter another URL or ENTER to quit: []
New urllist

Autoconfiguration complete.

commit: wrote '/home/divekar/.cpan/CPAN/'
cpan[7]> exit

Step 5  Install perl modules (one at a time in the following order):
cpan DBI
cpan DBD::Oracle
cpan App::cpanminus
cpan Encode::Locale
cpan Expect
cpan File::Listing
cpan HTML::Parser
cpan HTTP::Cookies
cpan HTTP::Daemon
cpan HTTP::Negotiate
cpan LWP
cpan Time-modules
cpan i /Time-modules/
cpan XML::NamespaceSupport
cpan XML::Parser
cpan XML::SAX
cpan XML::SAX::Expat
cpan XML::Simple

Step 6  Check installed perl modules
perl ~jingchen/bin/ or instmodsh

Created by Shashi Divekar.

Modified by Jingchen Zhou, on 07/18/13 .