Perl has come a long way since I first began using it.

Recently, I was testing an installation of SpamAssassin. (I am still not convinced that it does a better job than my homebrew spam filter, for a number of reasons, but it'd certainly be a relief to get a decent antispam system on my server that requires less care and feeding.) To install SpamAssassin, I needed to install some Perl libraries.

Back in the ole' days, that meant hunting down, manually building, and installing libraries, which indeed I was quite used to do.

But, for Perl at least, this is no longer necessary. Instead, there is CPAN, the Comprehensive Perl Archive Network.

To make a long story short, with any relatively recent Perl installation, the most up-to-date core bits of CPAN can be installed by the following command (as root, of course):

perl -MCPAN -e 'install Bundle::CPAN'

And once that is done, one can proceed with interactive installation of any desired module, as in the following example:

perl -MCPAN -e shell
o conf prerequisites_policy ask
install Mail::SpamAssassin

It's not rocket science, but it saves a truckload of time.

And just in case it is necessary (it was indeed necessary in my case, after I ran an installation of SpamAssassin without some optional modules, and I wanted to re-install it after I obtained the optional stuff), a forced upgrade can be accomplished using the command

force install Mail::SpamAssassin

Incidentally, there is one optional SpamAssassin prerequisite, Razor, that cannot be installed this way.