Installing Perl Modules
Grepmail is a utility written in Perl that extracts individual
messages from a mail file. Installation can be tricky because it
requires other perl modules. This article describes how to install
perl modules using grepmail as an example.
Step 1: unpack grepmail
tar -xzvf grepmail-5.23.tar.gz
If it says something like
Warning: prerequisite Mail::Mbox::MessageParser 1.1 not found.
Writing Makefile for grepmail
this means you must install MessageParser before grepmail can
You could Download MessageParser.pm from
http://www.cpan.org and install it manually. Since MessageParser.pm
doesn't come with a Makefile.PL, the file is simply copied to the
appropriate location. Unfortunately, figuring out the appropriate
location is not always easy. You could edit your perl script to force
it to look in a specific location, but this will cause problems later
when you forget what you did.
Alternatively, Perl modules can be installed interactively using the
following procedure. As root, type:
perl -MCPAN -e shell
It will say
Warning: Cannot install MessageParser, don't know what it is.
Try the command
If it finds the module, it will say
Module Mail::Mbox::MessageParser \
Install the module
Continue installing other modules until grepmail compiles with no
warnings; then stop.
Now the grepmail should install.
To reinstall everything, type
cpan> install Bundle::CPAN
If an installation bombs out for some reason, you have to quit and re-start.
Otherwise, it will simply repeat the message, "Won't test, Won't install."