Posts Tagged ‘cpan’

Upgrading to perl 5.10

Monday, June 30th, 2008

Get the list of your installed 5.8 modules:

perl -MExtUtils::Installed -e'print join("\n", new ExtUtils::Installed->modules)' > module.list

then install Perl 5.10:

wget http://www.cpan.org/src/perl-5.10.0.tar.gz
tar xzf perl-5.10.0.tar.gz
cd perl-5.10.0
sh Configure -de -Dprefix=/opt/perl -Duserelocatableinc
make && make test
sudo make install
/opt/perl/bin/perl -e 'use feature qw(say); say "hi"'

and then re-install your modules

cpan `cat module.list`

Mirror cpan

Friday, June 20th, 2008

For the last 10 months, I’ve been living with no internet connection at
home (not on purpose, but this is another story), so I’ve tried to be as
much as possible independent from the web. I’ve started to use git for
being able to work off-line, I use Vim as a wiki on my computer, my blog
engine for writing post off-line, …

As as perl developer, I use a lot the CPAN. So, I’ve start to mirror the
CPAN on my computer. Here is how:

First, you will need the minicpan:

cpan CPAN::Mini

Then, edit a .minicpanrc file and add the following:

    local: /path/to/my/mirror/cpan
    remote: ftp://ftp.demon.co.uk/pub/CPAN/

And to finish, add this in your crontab:

    5 14 * * * /usr/local/bin/minicpan > /dev/null 2>&1

Everyday, at 14h05, your cpan will be updated.

Now use the CPAN cli:

sudo cpan

and do the following

cpan[1]> o conf urllist unshift file:///path/to/my/mirror/cpan

And voilà, I’ve got my own minicpan on my computer, so I can install
everything when I need it, being off-line or not.