Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: Strings mangled on printing

by RonW (Parson)
on Jun 04, 2015 at 17:02 UTC ( [id://1129077]=note: print w/replies, xml ) Need Help??


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

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

Update: Correct typo (per reply).

Replies are listed 'Best First'.
Re^4: Strings mangled on printing
by sn1987a (Deacon) on Jun 04, 2015 at 18:56 UTC

    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://1129077]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-03-28 18:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found