Actually, $inp =~ s/\s$//; will remove only a single whitespace character at the end of the line.
Use $inp =~ s/\s+$//; to remove all of them.
In reply to Re^4: Strings mangled on printing
by sn1987a
in thread Strings mangled on printing
by gordu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |