Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Re: Re: Re: Re: Handling Mac, Unix, Win/DOS newlines at readtime...

by bart (Canon)
on Sep 17, 2002 at 04:05 UTC ( #198427=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Re: Handling Mac, Unix, Win/DOS newlines at readtime...
in thread Handling Mac, Unix, Win/DOS newlines at readtime...

I remember reading somewhere in this thread that \r and \n have reversed semantics on the Mac (vs. *nix, Windows).

Um, no, that statement hasn't been made on this thread.

Oh yes it has. On a Mac, "\n" is "\015" (native end-of-lines), and "\r" is the other one, "\012". The sequences you can encounter, in Ascii, are matched by /\015\012|\015|\012/.

In addition, "\015\015\012" can occur too, in HTML pages you can download from the web, because of an erroneous FTP upload from Windows to Unix, as binary — and a download as text, which adds another CR.

  • Comment on Re: Re: Re: Re: Re: Handling Mac, Unix, Win/DOS newlines at readtime...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://198427]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2018-06-23 15:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (125 votes). Check out past polls.

    Notices?