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); }
In reply to Re: Oddity with \r printing
by revdiablo
in thread Oddity with \r printing
by MrMadScience
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |