Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Carrige Return and Line Feed in Perl. (s/\s+$//)

by tye (Sage)
on Mar 02, 2011 at 03:46 UTC ( [id://890890]=note: print w/replies, xml ) Need Help??


in reply to Re: Carrige Return and Line Feed in Perl.
in thread Carrige Return and Line Feed in Perl.

s/\s+$//

Much better than chomp. Trailing whitespace should never be significant, so don't let it be.

- tye        

Replies are listed 'Best First'.
Re^3: Carrige Return and Line Feed in Perl. (s/\s+$//)
by Argel (Prior) on Mar 02, 2011 at 22:44 UTC
    That's a very good point. If it did matter it would be a rare/edge case, so just getting rid of the extra whitespace by default makes sense!!

    Elda Taluta; Sarks Sark; Ark Arks

Re^3: Carrige Return and Line Feed in Perl. (s/\s+$//)
by dannyd (Sexton) on Mar 02, 2011 at 12:09 UTC

    Will be trying/reading all the suggestions/links.

    Things are a lot clearer now, thank you all for the insight.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-25 06:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found