1. Check the currently verion of Perl
# perl -v
This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi …… |
2. Install Perlbrew
# curl -L http://xrl.us/perlbrewinstall | bash
# source ~/perl5/perlbrew/etc/bashrc
3. You may need to add the following red line in ~/.bash_profile to make Perlbrew be auto included
# vim ~/.bash_profile
# .bash_profile# Get the aliases and functions if [ -f ~/.bashrc ]; thCen . ~/.bashrc fi# User specific environment and startup programs PATH=$PATH:$HOME/bin export PATH source ~/perl5/perlbrew/etc/bashrc |
4. Check the available version of Perl that can be installed by using Perlbrew.
# perlbrew available
perl-5.25.7 perl-5.24.0 perl-5.22.2 perl-5.20.3 perl-5.18.4 perl-5.16.3 perl-5.14.4 perl-5.12.5 perl-5.10.1 perl-5.8.9 perl-5.6.2 perl5.005_04 perl5.004_05 cperl-5.25.1 cperl-5.24.1 cperl-5.25.0 cperl-5.24.0 |
5. Install the version of Perl that you want
# perlbrew install perl-5.25.7
It may takes 30 minutes to install, you can use the following commands to track the status:
# tail -f ~/perl5/perlbrew/build.perl-5.25.7.log
You may list the installed perl and other libraryies by
# perlbrew list
perl-5.25.7 |
6. Then you can create a local::lib roots inside Perl installation
# perlbrew lib create perl-5.25.7@lib001
# perlbrew list
perl-5.25.7 perl-5.25.7@lib001 |
7. And you can use the following command to switch to that Perl installation
# perlbrew switch perl-5.25.7@lib001
# perl -v
This is perl 5, version 25, subversion 7 (v5.25.7) built for x86_64-linux (with 1 registered patch, see perl -V for more detail) |
8. And then installing the modules needed.
# perlbrew install-cpanm
# cpanm [Module name](Install any module you needed)
Reference:
http://www.openfoundry.org/tw/tech-column/8514-perlbrew-perl-installation-management-tool