首页 > 代码库 > perl的安装和版本切换工具-perlbrew

perl的安装和版本切换工具-perlbrew

setenv PERL /opt/perl5 --设置新perl的起始安装路径

curl -kL http://install.perlbrew.pl | bash

source /opt/perl5/perlbrew/etc/bashrc

perlbrew init
perlbrew root (/opt/perl5/perlbrew) is initialized.

Append the following piece of code to the end of your ~/.bash_profile and start a
new shell, perlbrew should be up and fully functional from there:

    source ~/perl5/perlbrew/etc/bashrc

Simply run `perlbrew` for usage details.

Happy brewing!


perlbrew install perl-5.16.0

perlbrew switch perl-5.16.0

至此,当前perl已经切换到新安装的perl-5.16.0

如果想再切换回旧版的,

source /opt/perl5/perlbrew/etc/bashrc

perlbrew switch-off

perl -v 查看当前版本已经切回。

完毕!

参考:http://perlbrew.pl/

perl的安装和版本切换工具-perlbrew