sub format_time { my ( $h, $m, $s) = @; return sprinf "%.02d%.02d%.02d", $h, $m, $s; }