How do I install CPAN modules while using perlbrew?

I have started using perlbrew and installed perl-5.12.2.

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).

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

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


After installing perlbrew you could install cpanm through this command:

perlbrew install-cpanm

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

Everything should be working fine with "cpan" as well as "cpanm", that is: when switching perl with perlbrew, cpan sees the installed modules of the version you use.

While it's true that cpanm is the recommended tool to use with perlbrew, cpan allows for test reporting so that is what I always use.

Need Your Help

How perform task on JavaFX TextField at onfocus and outfocus?

java javafx-2 javafx javafx-8

I am working on JavaFX project. I need to perform some task on a JavaFX TextField.

Splitting gzipped logfiles without storing the ungzipped splits on disk

linux gzip text-files split

I have a recurring task of splitting a set of large (about 1-2 GiB each) gzipped Apache logfiles into several parts (say chunks of 500K lines). The final files should be gzipped again to limit the ...