or whatever.
I am processing some messages (SPAM) and have found invalid dates in
some of them (go figure eh?)
How do I get DateTime::Format::Mail->parse_datetime to not throw an
error (puke and die) when it gets a bad datetime? I thought loose would
handle that.
Here is the message Date: header using Mail::IMAPClient->parse_headers.
Nore the bogus offset.
Fri, 14 Mar 2008 10:16:32 +06-30
Here is how I'm trying to process it.
my $msgDate = q{Fri, 14 Mar 2008 10:16:32 +06-30};
my $md = DateTime::Format::Mail->new->loose;
$mDate = $md->parse_datetime( $msgDate );
# it pukes here!
if ( ! $mDate ) {
print STDERR "Crap ::: $msgDate\n\n";
}
Wrap in an eval?
Thanks,
Rod
--