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