Why not fix the time unconditionally?
sub fix_time { my( $time )= @_; $time =~ s/^(\d:\d\d)$/0$1/; return $time };
This replaces (if it finds) the leading single-digit number with a zero-padded number.
In reply to Re: Parsing a date time string
by Corion
in thread Parsing a date time string
by bangor
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |