The every day things from Thalamus' life.

Thalamus' Blog

28 April, 2012

Installing multiple versions of perl

Filed under: ComputerStuff_en — Thalamus @ 12:42

This is a note to myself on how to install perlbrew. Perlbrew makes it easy to have multiple versions of perl installed on one host – and even better. If something gets screwed up, you will not make problems with the globally installed perl of the OS.

The steps beneath is almost an exact copy of this great article :

http://blog.fox.geek.nz/2010/09/installing-multiple-perls-with.html

$ cd ~
$ curl -LO http://xrl.us/perlbrew
$ perl ~/perlbrew install
$ rm ~/perlbrew
$ ~/perl5/perlbrew/bin/perlbrew init

Execute what the init tells you to do, and add the following to your own .bashrc.

source ~/perl5/perlbrew/etc/bashrc

Now, setup your CPAN mirror.

$ perlbrew mirror

I picked ‘127’ – university of Bergen.

$ perlbrew -v install perl-5.14.2
$ perlbrew switch perl-5.14.2
$ curl -L http://cpanmin.us | perl - App::cpanminus
$ cpan

Fill in the questions and once finished do a

$ o conf commit
$ q
$ cpanm --interactive -v App::cpanoutdated
$ cpan-outdated
$ cpanm --interactive -v App::CPAN::Fresh

From now on – write your perl scripts with

#!/bin/env perl

instead of

#!/bin/perl

and install your modules with the use of cpanm

cpanm IPC::System::Simple
• • •