Perlbrew

From Asenjo
Revision as of 13:37, 8 July 2012 by Natxo (Talk | contribs)

Jump to: navigation, search

Installing a system-wide perlbrew Perl

perlbrew for multiple users

  1. create a directory where perlbrew will install the new Perl version:
# mkdir /opt/perl5 [enter]

I chose to do it in /opt/perl5; if we change the permissions on this directory, we do not need to run the rest as root.

  1. declare a (temporary) environment variable PERLBREW_ROOT
$ export PERLBREW_ROOT=/opt/perl5
  1. download the perlbrew script and run it:
$ curl -L http://xrl.us/perlbrewinstall | bash [enter]
$ /opt/perlbrew/bin/perlbrew init [enter]

I actually reviewed the script before executing it, do not just run stuff off the internet without knowing what you are doing.

  1. modify your login script

In my case I use the bash shell, so I modified my .bashrc file:

export PERLBREW_ROOT=/opt/perl5
source /opt/perl5/etc/bashrc
source /opt/perl5/etc/perlbrew-completion.bash

After this, just install a new Perl version. You will need a c compiler, make and patch