in reply to text reformatting woes
Update: the chomp isn't even needed, since you've split on /\n/. Just replace chomp($l1) with $l1.
Update (more comments): you are using $4 and $8 without checking that the match succeeded. I'd at the very least say
and preferably also addif ($l2 =~ s/..../..../) { # $x and $y munging code # and substitution back into $l2 }
I see from your use of \1,\2, etc. that you aren't using warnings; stick a use warnings; and use strict; at the top, declare your variables (with real names instead of l1, l2, etc.), and see what other problems turn up for you.else { warn "houston, we have a problem: $l2 "; }
If $x or $y end up getting incremented, I think they may lose trailing zeros; if this is a problem, replace ++$x with $x = sprintf "%.2d", $x+1;; better yet, replace your whole substitution/rounding code with
Update: even that has problems with 01:59:59,995 (which I'm guessing should become 02;00;00;00). Easiest way to avoid that is just add up total milliseconds and then divide it back out into hr,min,sec,centisecs.s!(\d\d)\:(\d\d)\:(\d\d),(\d\d\d) --> (\d\d)\:(\d\d)\:(\d\d),(\d\d\d)! +sprintf("%s;%s;%s;%02.0f %s;%s;%s;%02.0f",$1,$2,$3,$4/10,$5,$6,$7,$8/ +10)!e
|
|---|