Equivalent of Perl chomp?

Aahz Maruch aahz at panix.com
Thu Jan 31 19:41:33 EST 2002


In article <86aduup3zu.fsf at k0dez.scriptkiddie.net>,
A Meowbot  <meowbot at meowing.net> wrote:
>Erno Kuusela <erno-news at erno.iki.fi> wrote:
>>
>> in dos text mode, all cr-lf sequences are translated into lf upon
>> reading and lf into cr-lf upon writing, at file i/o time. unless you
>> are using binary mode, in which no translation is done. so even in
>> dos, the strings you have in memory always end in lf (when read from a
>> file opened in text mode).
>
>Where things get yucky is when you are reading a Microsoft-formatted
>file or a network stream under Unix, where there is no difference
>between text and binary.  It's for those all-too-common cases that
>both line endings need to be taken into account.
>
>I don't even want to talk about the Apple CR thing.

How does Perl deal with this?
-- 
                      --- Aahz  <*>  (Copyright 2002 by aahz at pobox.com)

Hugs and backrubs -- I break Rule 6                 http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista   

"The more you drive, the less intelligent you are."  --_Repo Man_



More information about the Python-list mailing list