in reply to Re^2: Native newline encoding
in thread Native newline encoding
It should be, for example, 0d0a on Windows ... I don't really do Windows
That's a bit obvious :)
It isn't perl(*) that writes the extra character; it is the C runtime (when writing to a data file opened as text). Those extra characters are also stripped by the CRT when reading -- assuming text mode.
If Perl added them itself, then the CRT would also do it and you'd end up with a real mess.
perl; and Perl programmers shouldn't need to concern themselves with the details, because -- unless they are reading text files in bin mode; which they shouldn't be -- the addition and removal of the 'extra characters' should be entirely transparent.
(*) ignoring PerlIO which does; but only because it bypasses the CRT and then emulates it -- the point of which mystifies me, but there it is.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Native newline encoding
by Anonymous Monk on May 22, 2012 at 19:09 UTC | |
|
Re^4: Native newline encoding
by sauoq (Abbot) on May 22, 2012 at 18:34 UTC | |
by BrowserUk (Patriarch) on May 22, 2012 at 18:49 UTC | |
by sauoq (Abbot) on May 22, 2012 at 19:03 UTC | |
by BrowserUk (Patriarch) on May 22, 2012 at 19:12 UTC | |
by sauoq (Abbot) on May 22, 2012 at 19:41 UTC | |
|
Re^4: Native newline encoding
by sauoq (Abbot) on May 22, 2012 at 18:45 UTC |