The aforementioned
Net::POP3 is a good module, although I prefer
Mail::POP3Client. Here is a sample of its interface:
# taken from perldoc Mail::POP3Client...
use Mail::POP3Client;
$pop = new Mail::POP3Client( USER => "me",
PASSWORD => "mypassword",
HOST => "pop3.do.main" );
for( $i = 1; $i <= $pop->Count(); $i++ ) {
foreach( $pop->Head( $i ) ) {
/^(From|Subject):\s+/i && print $_, "\n";
}
}
There are ample scripts about the monastery which deal with reading email and writing the file. You would do something like add this line to the above text:
open FILE, "filename" or die "no file! $!";
print FILE $pop -> Body( $i );
close FILE or warn "$!";
--
Laziness, Impatience, Hubris, and Generosity.