in reply to A would-be simple substitution...
This also makes it easier to yell if the data didn't conform to expectations:$time = "$1:$2:$3.$4" if $time =~ /^(\d{2})(\d{2})(\d{2})\.(\d{2})/;
if($time =~ /^(\d{2})(\d{2})(\d{2})\.(\d{2})/) { $time = "$1:$2:$3.$4"; } else { die "Malformed time: $time\n"; }
Makeshifts last the longest.
|
|---|