Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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

by tye (Sage)
on Mar 02, 2011 at 03:46 UTC ( #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 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.

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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2020-05-25 05:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (143 votes). Check out past polls.

    Notices?