1nickt has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

I have a strange set of error messages when trying to use perlbrew to test some modules on a old perl.

[08:25][nick:~]$ perlbrew list * perl-5.6.0 perl-5.16.0 [08:25][nick:~]$ perl -v | head -2 This is perl, v5.6.0 built for darwin [08:25][nick:~]$ cpan Test::More Going to read '/Users/nick/.cpan/Metadata' ...

I didn't expect cpan to look there ... ? Wouldn't there be a .cpan/Metadata in each perl dist directory tree?

Installation proceeds, all tests pass for first dependency (Test::Simple) , then at the end:

... All tests successful. Files=118, Tests=1378, 9 wallclock secs ( 0.53 usr 0.39 sys + 5.34 +cusr 2.15 csys = 8.41 CPU) Result: PASS EXODIST/Test-Simple-1.001014.tar.gz make test -- OK Running make install !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! ERROR: Can't create '/Library/Perl/5.12' Do not have write permissions on '/Library/Perl/5.12' !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! at -e line 1 make: *** [pure_site_install] Error 13 EXODIST/Test-Simple-1.001014.tar.gz make install -- NOT OK

I REALLY didn't expect perlbrew to try to copy a file to a dir with 5.12 in the name .... ?

Tried with cpanm since it came with perlbrew:

[08:26][nick:~]$ cpanm Test::More Not a CODE reference at /Users/nick/perl5/perlbrew/bin/cpanm line 507. BEGIN failed--compilation aborted at /Users/nick/perl5/perlbrew/bin/cp +anm line 507.

Is all this because 5.6.0 is just too old? Or do I have my perlbrew configured wrongly?

Thanks!

Remember: Ne dederis in spiritu molere illegitimi!

Replies are listed 'Best First'.
Re: perlbrew and CPAN
by kcott (Archbishop) on Jul 12, 2015 at 17:07 UTC

    G'day 1nickt,

    [Disclaimer: all of the following is based on (educated) guesses.]

    Firstly, /Library/Perl/5.12 indicates your system Perl (i.e. /usr/bin/perl). If you type '/usr/bin/perl -V', that should confirm v5.12; plus you'll see a number of paths (mostly under @INC) starting in the /Library, /System or /Network directories and containing '.../5.12/...' somewhere in each path.

    Paths to your perlbrew versions of perl, cpan, etc. will be in a directory like /Users/nick/perl5/perlbrew/perls/perl-5.6.0/bin/.

    However, I suspect the cpan utility wasn't part of the core distribution for v5.6. I seem to recall when I last used v5.6 (over a decade ago), I used CPAN interactively like this:

    perl -MCPAN -e shell

    So, check your $PATH, which probably looks something like:

    ...:/Users/nick/perl5/perlbrew/perls/perl-5.6.0/bin:...:/usr/bin:...

    If my guesses have been good ones up to now, the following two commands will produce the output shown:

    $ which perl /Users/nick/perl5/perlbrew/perls/perl-5.6.0/bin/perl $ which cpan /usr/bin/cpan

    So, Perl v5.6.0 isn't too old, it just didn't include the cpan utility by default — you'll need to install this yourself. Also, from the little you've shown in your post, I don't see any glaring problems with your perlbrew configuration.

    — Ken

      Thanks Ken. You nailed it. I had been using 5.16 under perlbrew for so long that I forgot about my system perl being 5.12. And sure enough perl -MCPAN -e shell worked nicely, and was a charming trip down memory lane.

      Thanks a million mate.

      Remember: Ne dederis in spiritu molere illegitimi!