$length = 1; while (doing operation) { for (1..$length){print "\b"} print $numberOfRecords; $length = length($numberOfRecords); }