while ($time > 0) { print " " . ' ' x (3 - length($time)) . "$time $line"; foreach (1..$backcount){print "\b"} $time -= 1; sleep 1; }