in reply to newline for Unicode?

\r\n?

Replies are listed 'Best First'.
RE: Re: newline for Unicode?
by BlueLines (Hermit) on Jun 16, 2000 at 23:48 UTC
    yeah. windows thinks of a newline differently than unix, which thinks differently than macs. I found this out when dealing with webservers on different platforms.I wanted to split the return from a web request into the header and the http data.( the header is separated from the data by two newlines). So in order to make this work cross platform, i had to use this:
    my ($header , $data) = split (/\n\n|\r\n\r\n|\r\r/ , $result, 2);

    this handles unix newlines, \r\n (windows newline), and \r for the macs.