4
votes

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
Did you install cpanm with perlbrew install-cpanm? What does which cpanm show? - ThisSuitIsBlackNot
@ThisSuitIsBlackNot thanks for the quick response. Doing perlbrew install-cpanm returns cpanm is installed to /home/qwerty/perl5/perlbrewbin/cpanm. When I do which cpanm I get /home/qwerty/perl5/perlbrew/bin/cpanm - mrk

1 Answers

0
votes

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?