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

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

Thread Previous | Thread Next
Tom Christiansen
November 22, 1999 06:55
Re: [ID 19991119.003] chomp() can be confusing
Message ID:
>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.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About