Installing additional Perl Modules from CPAN

Firstly, check the module isn't already installed either in a package or from CPAN. You can do this by listing all the Perl modules in the includes directories:

find `perl -e 'print "@INC"'` -name '*.pm' -print

Debian machines ship just about every CPAN module you want in a deb, so use apt-get to install them, keeping the packaging system happy.

On Red Hat, though, you have to use CPAN itself. You can install CPAN modules system wide, because CPAN is quite mature and doesn't interfere with the RPM database.

Some machines have a cpan command, which is just a wrapper around:

perl -MCPAN -e shell

This command will work on all machines.

cfengine hosts will have CPAN already configured for use.

To install a package, say MIME::Lite type:

install MIME::Lite

and ^D to leave the CPAN shell.