http://qs321.pair.com?node_id=509689


in reply to Time::Piece strangeness

#!/usr/bin/perl use DateTime::Format::Strptime; my $strp = DateTime::Format::Strptime->new( pattern => '%d-%m-%Y', on_error => 'croak', ); my $dt = $strp->parse_datetime("31-02-2006"); print $dt->datetime, "\n";
results: "Invalid day of month (day = 31 - month = 02)"

You can assign any handler you want to 'on_error'

Cheers,
Matt