installing modules when using perlbrew

风流意气都作罢 提交于 2019-12-10 22:04:27

问题


I am trying to use perlbrew to run a set of perl scripts. When I try installing dependencies for these perl scripts, they are installed into my system's perl version (5.18.X) and not the version I want to use (5.10.1). I have tried several suggestions from other threads on stackoverflow, but to no avail.

Here's an example of what happens. I'll do the following:

perlbrew use perl-5.10.1

perl -v (returns with perl-5.10.1)

cpanm Parallel::ForkManager (returns Paralell::ForkManager is installed)

When I run my script using under perlbrew I get the following:

perl PERLSCRIPT.pl

Can't locate Parallel/ForkManager.pm in @INC (@INC contains: /home/qwerty/perl5/perlbrew/perls/perl-5.10.1/lib/5.10.1/x86_64-linux-thread-multi /home/qwerty/perl5/perlbrew/perls/perl-5.10.1/lib/5.10.1 /home/qwerty/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux-thread-multi /home/qwerty/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1

Any help is appreciated. If any other information is needed, please let me know.

System OS: Ubuntu 64-bit run through VMware (host is Windows 8.1 pro);

Edit: It seems that doing perlbrew exec cpanm perl::module works. However, If anyone has other suggestions, I'd be glad to hear them.


回答1:


Try using

perlbrew switch perl-5.10.1

instead of

perlbrew use perl-5.10.1

The "use" command only sets the perl for the current shell. Maybe you switched shells in between?



来源:https://stackoverflow.com/questions/29436961/installing-modules-when-using-perlbrew

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!