CPAN on Snow Leopard

CPAN, the Comprehensive Perl Archive Network is a free community provided library of Perl programs.
Installing CPAN
Here are instructions for setting up a 64-bit CPAN on Snow Leopard, tested August 2010 with 10.6.4.
For the most current version of OS X, see CPAN instructions for Lion (10.7).
These instructions assume you have already disabled .my.cnf and reinstalled MySQL.
- If you have a /var/root/.cpan, rename it or delete it.
- Change your shell environment to export ARCHFLAGS="-arch i386 -arch x86_64"
- Change your shell environment to export VERSIONER_PERL_PREFER_32_BIT=no to avoid errors from dyld
- This process will ask a lot of questions at the beginning, about where to fetch files from and whether to install dependencies. Just keep saying OK, etc.
sudo -H cpan
Then install the modules you want. The ones I use are:
- install Bundle::CPAN
- install DBI
- install Crypt::CBC
- install Crypt::Twofish
- install News::NNTPClient -- set NNTPSERVER first
- install DBD::mysql -- MySQL must be installed first and no root password
- install Net::DNS, Geo::IP::PurePerl, Digest::SHA, Compress::Raw::Zlib, Compress::Raw::Bzip2
- In the future, I may try install W3C-LinkChecker, URI, CSS::DOM, HTML-Parser, Time-HiRes but some of these get errors
- Set the MySQL root password with mysqladmin -u root password WHATEVER .
- Reinstate .my.cnf
- mysql dbname < db.sql
(Gotcha:) For some reason, when I tried this in 2010, sudo -H cpan failed.
where cpan said it was there.
It turned out that something had changed the access on /usr/bin/cpan to 666. I changed it to 755 and all worked.
Home | FAQ
© 2010-2012, Tom Van Vleck
updated 2012-04-04 19:04