develooper Front page | perl.perl5.porters | Postings from July 2005

[perl #1807] chomp() can be confusing

From:
Michael G Schwern via RT
Date:
July 12, 2005 19:26
Subject:
[perl #1807] chomp() can be confusing
Message ID:
rt-3.0.11-1807-117115.0.945992366815886@perl.org
> [Ben_Tilly@trepp.com - Thu Nov 18 23:18:09 1999]:
> 
> Is there any possibility of having chomp() be modified to recognize
\n, \r,
> and \r\n as line-endings to chomp?

Do you mean that chomp(), rather than being equivalent to:

    s{$/\z}{};

should be:

    s{(\r|\n|\r\n)\z}{};

?




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About