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