How to install Perl 5.16 on CentOS 6 from source

This is a step by step installation of Perl 5.16 on Linux CentOS 6. Note:

  • run command one by one so you can spot any possible errors.

Step to complete this taskĀ 

  • all the command bellow must be done as the root user. Untar the perl ball
tar -xf perl-5.16.0.tar
Move inside the perl folder
cd perl-5.16.0
Install make and gcc if not already installed
yum -y install make
yum -y install gcc
Setup perl home
./Configure -des -Dprefix=/opt/perl5/perls/perl5.16
Start perl compilation
make
make test
make install
Remove old symbolic link
rm /usr/bin/perl
Create new symbolic link for the new perl install
ln -s /opt/perl5/perls/perl5.16/bin/perl /usr/bin/perl
Vertify perl version
perl -v

This is perl 5, version 16, subversion 0 (v5.16.0) built for x86_64-Linux

Copyright 1987-2012, Larry Wall
Install pelrbrew
wget -O - http://install.perlbrew.pl | bash
source ~/perl5/perlbrew/etc/bashrc
Install cpanm tool
perlbrew install-cpanm
Install perl modules
perldoc time::piece
perlbrew install-cpanm
cpanm -v DBI
cpanm -v DBD::ODBC
cpanm -v YAML
cpanm -v Time::Piece
cpanm -v Crypt::TripleDES