Difference between revisions of "Perlbrew"
From Asenjo
m |
|||
Line 24: | Line 24: | ||
# modify your login script | # modify your login script | ||
− | In my case I use the bash shell, so I modified my .bashrc file: | + | In my case I use the bash shell, so I modified my .bashrc file (log off and back in to see the changes later): |
<code><pre> | <code><pre> | ||
Line 32: | Line 32: | ||
</pre></code> | </pre></code> | ||
− | After this, just install a new Perl version. You will need a c compiler, make and patch | + | After this, just install a new Perl version. You will need a c compiler, make and patch: |
+ | |||
+ | <code><pre> | ||
+ | $ perlbrew install perl-5.14.2 [enter] | ||
+ | $ perlbrew switch perl-5.14.2 [enter] | ||
+ | </pre></code> | ||
+ | |||
+ | The 1st step could take a long time depending on how fast your host is. After it is done, you will have a new Perl at your disposal. | ||
+ | |||
+ | <code><pre> | ||
+ | $ perl -v | ||
+ | |||
+ | This is perl 5, version 14, subversion 2 (v5.14.2) built for i686-linux | ||
+ | |||
+ | Copyright 1987-2011, Larry Wall | ||
+ | ..... | ||
+ | </pre></code> | ||
+ | |||
+ | and this is the system's Perl: | ||
+ | |||
+ | <code><pre> | ||
+ | $ /usr/bin/perl -v | ||
+ | |||
+ | This is perl, v5.10.1 (*) built for i386-linux-thread-multi | ||
+ | |||
+ | Copyright 1987-2009, Larry Wall | ||
+ | .... | ||
+ | </pre></code> |
Revision as of 13:43, 8 July 2012
Installing a system-wide perlbrew Perl
- 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.
- declare a (temporary) environment variable PERLBREW_ROOT
$ export PERLBREW_ROOT=/opt/perl5
- 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.
- modify your login script
In my case I use the bash shell, so I modified my .bashrc file (log off and back in to see the changes later):
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:
$ perlbrew install perl-5.14.2 [enter]
$ perlbrew switch perl-5.14.2 [enter]
The 1st step could take a long time depending on how fast your host is. After it is done, you will have a new Perl at your disposal.
$ perl -v
This is perl 5, version 14, subversion 2 (v5.14.2) built for i686-linux
Copyright 1987-2011, Larry Wall
.....
and this is the system's Perl:
$ /usr/bin/perl -v
This is perl, v5.10.1 (*) built for i386-linux-thread-multi
Copyright 1987-2009, Larry Wall
....