chomp $line;
You still have the carriage returns (\r) at the end of your strings, which will move the cursor to the start of the line again and then overwrite stuff.
I recommend stripping all whitespace from the end of the strings:
$line =~ s!\s*$!!;
In reply to Re: print Is Substituting Characters At Beginning Of String
by Corion
in thread print Is Substituting Characters At Beginning Of String
by shilo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |