Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^2: Strings mangled on printing

by gordu (Initiate)
on Jun 03, 2015 at 17:51 UTC ( [id://1128978]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1128978]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-25 16:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found