Here is the procedure that I went thru to add perl into a user directory:
- Setup the directories:
cd
mkdir perl5
mkdir perl5/bin
mkdir perl5/lib
mkdir perl5/man
mkdir perl5/man/man1
- Download the source (See this link for URLs: http://www.cpan.org/src/README.html)
wget http://www.cpan.org/src/5.0/perl-5.10.1.tar.gz
- Unpack it
tar zxvf perl-5.10.1.tar.gz
- Install it
cd perl\-5.10.1
./Configure -des -Dusethreads -Dprefix=$HOME/perl5
make test && make install
- Configure PERL5LIB (add to .profile)
export PERL5LIB=$HOME/perl5:$HOME/perl5/site_perl
- Install cpanm
$HOME/perl5/bin/cpan App::cpanminus
- Install LWP
$HOME/perl5/bin/cpanm LWP
Install XML::Parse and Expat:
- Download Expat: http://sourceforge.net/projects/expat/files/expat/
wget http://sourceforge.net/projects/expat/files/expat/2.1.0/expat-2.1.0.tar.gz/download
- Compile Expat
tar -zxvf expat-2.1.0.tar.gz
cd expat-2.1.0
./configure --prefix=$HOME/usr
make
make install
- Install XML::Parser
cd
perl5/bin/cpan
o conf makepl_arg "EXPATLIBPATH=/prod/user/home/boz604/usr/lib EXPATINCPATH=/prod/user/home/boz604/usr/include"
o conf commit
install XML::Parser
quit
Install Net::SSLeay and OpenSSL and Zlib:
- Download OpenSSL
wget http://www.openssl.org/source/openssl-1.0.1e.tar.gz
- Compile OpenSSL
tar -zxvf openssl-1.0.1e.tar.gz
cd openssl-1.0.1e
./config
shared --prefix=$HOME/usr --openssldir=$HOME/usr/openssl
make
make test && make install
- Download Zlib
wget http://www.zlib.net/zlib-1.2.8.tar.gz
- Compile Zlib
tar -zxvf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure --prefix=$HOME/usr
make
make test && make install
- Install Net::SSLeay
cd
OPENSSL_PREFIX=$HOME/usr perl5/bin/cpan Net::SSLeay
- Install LWP::Protocol::https
cd
perl5/bin/cpanm LWP::Protocol::https
Here is how to set custom Include and Lib directories:
- In CPAN:
perl5/bin/cpan
o conf makepl_arg "LIBS=-L$HOME/usr INC=-I$HOME/usr/include"
o conf commit
- When running perl:
perl -I $HOME/perl5/lib/site_perl
- Inside your perl script
use lib "/home/user/perl5/lib/site_perl";
Hello please how do I check my directory or should I just type same thing u wrote?I want to install in my windows and virtual box Linux?
ReplyDeleteThe above commands are all for linux. For checking a linux directory use the `ls` command.
DeleteThis comment has been removed by a blog administrator.
ReplyDelete