How to install system wide perl5.18 on CentOS6.5
Perl version on CentOS is 5.10 by default. It’s a bit old, so most of the perl developers install the latest perl on his home directory by perlbrew or plenv. This time, for a program to be executed by Jenkins, I wanted to install system wide perl on the Jenkins server.
The below is example to install system wide perl using “plenv” which is very popular in Japan. (See the benefit of plenv over perlbrew - http://weblog.bulknews.net/post/58079418600/plenv-alternative-for-perlbrew)
$ export PLENV_ROOT=/opt/perl5 # wherever you want to install $ mkdir -p /opt/perl5 $ git clone git://github.com/tokuhirom/plenv.git $PLENV_ROOT $ git clone git://github.com/tokuhirom/Perl-Build.git $PLENV_ROOT/plugins/perl-build/ $ $PLENV_ROOT/bin/plenv install 5.18.2 $ $PLENV_ROOT/bin/plenv rehash $ $PLENV_ROOT/bin/plenv global 5.18.2 $ $PLENV_ROOT/bin/plenv install-cpanm $ $PLENV_ROOT/bin/plenv rehash
And you can call the below in your ~/.bash_profile or the shell script to run the program.
export PLENV_ROOT=/opt/perl5 export PATH="$PLENV_ROOT/bin:$PATH" eval "$(plenv init -)"