A Little History on 0D0A
http://www.perlmonks.org/index.pl?node_id=68687
in reply to Cross platform file I/O code Blame it on the typewriters - better yet, that lever or button on the right side of them. The one used to start typing on the next line. When you activate it, it causes
Why were they adopted? For printers of course. The concept of the tty was split into two - a monitor and a printer. At this point, it was up to the various operating systems to implement their actual use. Oops. UPDATE: Disregard that last table, kept only for historical purposes. Here is a better table, one that shows how the three different operatiing systems interpret a logical newline (ps, thanks Mr. Stein =] ) This only causes problems when you transfer ASCII files around different operating systems as binary data, in which case you should use binmode - or when you are programming with sockets, in which case you will need to set $/ to '\015\012' or just use the exported globals $CRLF and CRLF() from the Socket or IO::Socketmodules.So, the next time you find yourself cursing this confusion, just take a look at this typewriter history tree and remember that we are only human, except arhuman. :) Jeff R-R-R--R-R-R--R-R-R--R-R-R--R-R-R-- UPDATE: Thanks to the anonymous monk for clarifying things up.REFERENCES:
|