I did an example install of CPAN::Mini for the meeting. This was a learning experience for me, as I'd only briefly heard of it before and this was my first install.
CPAN::Mini makes a minimal private mirror of CPAN, of all the current release versions of all the CPAN modules!
The idea is you keep this mirror up-to-date and anytime you need to install a module, you have it available. To keep the repository more manageable only the current version of each module is mirrored. Installation was super simple, the hardest being polling the room for a preferred CPAN mirror. We settled on ASK's develooper.com.
% cpan CPAN::Mini
% mkdir -p $HOME/mirrors/cpan
% minicpan -L $HOME/mirrors/cpan -R http://cpan.develooper.com/
Tommy then discussed his four favorite modules-of-the-moment for perl5 development and usage, one of which was App::cpanminus. I'd heard of this previously, but hadn't gotten around to testing it. It installs a binary, cpanm, that is used to install modules. It tries to just do-the-right-thing, and install modules and keep the output to a minimum. I especially liked the flag to install to a local::lib maintained directory, which is useful in a sudo case where environment variables are annoying to pass.
I then tried to merge the two. First I installed App::cpanminus from my local CPAN::Mini mirror using cpan with the network unplugged. Success!
Then I tried to install a module with cpanm, and found that it was going to the network even though my repo was at a file:// url. Bummer!
I haven't gotten back to testing this, and a brief search found one comment from a user who reverts to cpan to use his CPAN::Mini mirror when he's away from the network. Does anyone have this working? Is it just part of the cpanminus magic that it looks online for the CPAN meta data?
My only reason to teach cpan.pm after that is to support CPAN::Mini and a local CPAN mirror. Thats the only reason I still use CPAN, I'm usually offline.
-- Pedro ,
- Thousand Oaks Perl Mongers
- C.P.A.N. -- the Comprehensive Perl Archive Network.
- Modern perl comment