Red Hat Enterprise Linux, CentOS and Scientific Linux 5.x come with Perl 5.8

Perl 5.8.8 was released in 2006 - it's nearly six years old now! Many modules on CPAN are starting to need 5.10 as a base version, so it's getting painful to try and use the stock Perl shipping in RHEL5 and its derivatives.

Starting with a fresh, rather small, install of CentOS 5.7 I decided to see if I could bootstrap a modern Perl with little to no pain.

It would appear you can. With the magic of perlbrew. The following can be done as your ordinary user ID, you do not need to be root.

yum install -y gcc curl -kL http://install.perlbrew.pl | bash source ~/perl5/perlbrew/etc/bashrc perlbrew install perl-5.14.3 --as 5.14 -Dusethreads -A ccflags=-fPIC -j 4 perlbrew switch perl-5.14 perlbrew install-cpanm cpanm Modern::Perl cpanm local::lib eval $(perl -Mlocal::lib)

I chose to install local::lib because it's one of the most genius things to happen to Perl in recent times. cpanm is incredibly handy, as is Modern::Perl. I install the last two before local:lib, so they're in the site_perl directory of the perlbrew'd perl.

Rolling with this setup means I can use a recent Perl and everything is neatly contained under ~/perl5 in my home directory.

Nice.


Comments

comments powered by Disqus