As moritz has said, testing
not defined is better than
== undef, but
$time{$recordNumber} isn't the only variable involved on that line... I suspect that
$recordNumber is the uninitialized value that it's complaining about.
(If $recordNumber is defined and $time{$recordNumber} isn't, I would expect to see the warning "Use of uninitialized value in numeric eq (==) at...".)