in reply to Re: Strings mangled on printing
in thread Strings mangled on printing

Arrgh!!!! So simple. I should have asked years ago. Yes that fixed it. Thank you!

Replies are listed 'Best First'.
Re^3: Strings mangled on printing
by RonW (Parson) on Jun 04, 2015 at 17:02 UTC

    Also note that $inp =~ s/\s+$//; will remove all trailing white space, including newlines (\n) and returns (\r).

    Update: Correct typo (per reply).

      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.