tags:

views:

66

answers:

2

I'm running on a Mac (version 10.6.3) and am struggling to understand what is going on with my Perl installation.

I let the system do a copy from my previous mac, and I appear to have a second perl installed, which appears earlier in my path. I can't tell (or remember) if I might have installed it with fink, macports or CPAN or what.

type -a cpan
cpan is /opt/local/bin/cpan
cpan is /usr/bin/cpan

I'm seeing two oddities. (To start with!) When I run cpan, and let it configure in ~lcuff/.cpan, each time I run it, it wants to reconfigure, giving the message:

Sorry, we have to rerun the configuration dialog for CPAN.pm due to some missing parameters...

Also, when I try to install File::Find::Rule (so I can list my CPAN modules, per the FAQ) I end up with an error message that I can't decipher or Google a solution for:

Use of inherited AUTOLOAD for non-method Digest::SHA::shaopen() is deprecated at /opt/local/lib/perl5/vendor_perl/5.8.9/darwin-2level/Digest/SHA.pm line 55.
Catching error: "Can't locate auto/Digest/SHA/shaopen.al in \@INC (\@INC contains: /sw/lib/perl5 /sw/lib/perl5/darwin /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level /opt/local/lib/perl5/site_perl/5.8.9 /opt/local/lib/perl5/site_perl /opt/local/lib/perl5/vendor_perl/5.8.9/darwin-2level /opt/local/lib/perl5/vendor_perl/5.8.9 /opt/local/lib/perl5/vendor_perl /opt/local/lib/perl5/5.8.9/darwin-2level /opt/local/lib/perl5/5.8.9 /Users/lcuff) at /opt/local/lib/perl5/vendor_perl/5.8.9/darwin-2level/Digest/SHA.pm line 55\cJ" at /opt/local/lib/perl5/5.8.9/CPAN.pm line 359
    CPAN::shell() called at /opt/local/bin/cpan line 198
+1  A: 

I just went through my first migration to a new Mac last week, including a switch from fink and system perl to MacPorts and custom perl, so I remember the pain all too well...

As Schwern said, /opt/local is the default install location for MacPorts; fink uses /sw.

I did encounter a similar problem with CPAN configuration, although I didn't make any attempt to determine whether it was repeatable or not.

The first time I ran CPAN config, it said that I had an existing CPAN dir at ~/.cpan and stored the configuration there.

The second time, it wanted to configure into an existing CPAN dir at ~/Library/Application Support/.cpan. I didn't feel like repeating the CPAN configuration, so I broke out, did a quick cd ~/Library/Application Support/.cpan ; rm -rf .cpan ; ln -s ~/.cpan ., and it's worked great for me since then.

Hopefully this will at least help get you pointed in the right direction.

Dave Sherohman
A: 

Have a look at Perlbrew.

Perlbrew allows you to install and manage mulitple versions for Perl under your home directory at ~/perl5

Installation is easy:

 curl -LO http://xrl.us/perlbrew
 chmod +x perlbrew
 ./perlbrew install

and simply follow the instructions.

Been using it for past few months on Mac OSX and it worked like a charm!

/I3az/

draegtun