develooper Front page | perl.perl5.porters | Postings from November 1999

Re: [ID 19991119.003] chomp() can be confusing

Thread Previous | Thread Next
From:
Tom Christiansen
Date:
November 22, 1999 06:55
Subject:
Re: [ID 19991119.003] chomp() can be confusing
Message ID:
199911221454.HAA21665@jhereg.perl.com
>The suggestion that I heard which I most like is letting $/ be an RE.  So
>you can make $/ be /\n|\r\n?/ and it magically "does the right thing" on
>virtually any file.  However integrating this logic into the RE engine
>could be interesting.  After all if you apply the pattern I gave to a
>string that ends with \r, it will match even if the next character to be
>read is \n.  This is manifestly not the right thing to do. :-(

Anything that deviates from the notion of internally representing the
line terminator as a single character (the virtual "\n") is a grave error.

--tom

Thread Previous | Thread Next


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