Overkill

Simon on 2002-06-10T10:50:53

A mailbox scanner: #!/usr/bin/perl use strict; use Mail::Util qw( read_mbox ); use Mail::Internet; use Mail::Address; use Time::Duration; use Date::Manip qw( ParseDate UnixDate ); for (map { Mail::Internet->new($_) } read_mbox("/home/simon/mail/pending")) { my $when = $_->get("Date"); my $who = (Mail::Address->parse($_->get("From")))[0]; $when = time - UnixDate(ParseDate($when), "%s"); print "Mail received ",ago($when), " from ",$who->phrase,"\n"; print "Subject: ", $_->get("Subject"),"\n"; } Fourteen lines, six Perl modules, to summarise a mailbox. What was I thinking?