can't call method "epoch" on an undefined value at a3.pl line 28 <$fh> line 28.
And if I were to guess what that clue/warning means, I'd say $dt, the value returned by parse_datetime, is undef. Perhaps the docs have something to say about why that would be...