in reply to Oddity with \r printing

The reason is \r moves the cursor back to the front of the line, but does not erase any of the text that's there. I usually use substr with spaces for padding to avoid this issue. Example:

my $width = 6; for (qw(1001 1002 200)) { print "\r" . substr($_ . " " x $width, 0, $width); }