Skip to content

The way to install newer version perl

jberger edited this page Mar 13, 2013 · 8 revisions

The way to install newer version perl

If you use CentOS < 6.0 or RedHat Enterprise Linux < 6.0, the Perl version is 5.8.x. Mojolicious doesn't support perl 5.8.x . You will need to install a newer version of perl.

Use perlbrew. It is easy to install perl to user directory.

Download perlbrew

curl -kL http://install.perlbrew.pl | bash

perlbrew is installed in the following directory.

~/perl5

Set perlbrew PATH.

echo "source $HOME/perl5/perlbrew/etc/bashrc" >> ~/.bashrc

Reload ".bashrc"

source ~/.bashrc

Install perl to user directory

Check which Perls can be installed

perlbrew available

Then install one, for example

perlbrew install perl-5.16.3

Or install faster with parallel jobs! Use -j #jobs

perlbrew install -j 5 perl-5.16.3

If you can't install perl, use -f option.

perlbrew install -f perl-5.16.3

Using your new Perl

List available perls.

perlbrew list

Available perls is displayed.

perl-5.16.3
    * /usr/bin/perl (5.8.8)

Switch perl.

perlbrew switch perl-5.16.3

Install cpanm

If you use cpanm for module installation, do this.

perlbrew install-cpanm
Clone this wiki locally