使用perlbrew时如何安装CPAN模块? [英] How do I install CPAN modules while using perlbrew?

查看:138
本文介绍了使用perlbrew时如何安装CPAN模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开始使用perlbrew并安装了perl-5.12.2.

I have started using perlbrew and installed perl-5.12.2.

我了解我需要重新安装CPAN模块,因此我切换到了新的Perl版本(perlbrew switch perl-5.12.2hash -r),验证了切换是否成功(perl -v),然后尝试安装了某些模块(File::Copy::Recursive使用cpan.但是,cpan表示`File :: Copy :: Recursive是最新的(0.38).

I understand I need to re-install my CPAN modules, so I switched to my new Perl version (perlbrew switch perl-5.12.2 and hash -r), verified the switch was successful (perl -v) then tried installing some module (File::Copy::Recursive using cpan. However, cpan says `File::Copy::Recursive is up to date (0.38).

当我使用此模块启动Perl脚本时,它会大喊Can't locate File/Copy/Recursive.pm in @INC ...(显示许多perl-5.12.2位置).当我切换回我的普通" Perl(perlbrew off)时,脚本运行良好.

When I start a Perl script using this module, it shouts Can't locate File/Copy/Recursive.pm in @INC ... (showing many perl-5.12.2 locations). When I switch back to my 'normal' Perl (perlbrew off) the script runs fine.

有什么建议吗?也许CPAN在perlbrew下不能很好地工作?

Any suggestions? Perhaps CPAN does not work well with perlbrew?

推荐答案

安装perlbrew之后,您可以通过以下命令安装cpanm:

After installing perlbrew you could install cpanm through this command:

perlbrew install-cpanm

否则,每次在perlbrew上切换Perl版本时,都需要手动安装cpanm.只需使用此命令一次即可.

Otherwise you will need to install cpanm manually each time you switch your Perl version on perlbrew. With this command just once.

这篇关于使用perlbrew时如何安装CPAN模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆