Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I dislike Microsoft as much as the next guy (probably more), but the history [wikipedia.org] says that the real blame here is in the design of printers. As a result the division between systems that used \r\n versus \n goes back to the mid-60s, which is comfortably before either Unix or Windows was created.

    In particular Windows inherited \r\n from DOS, which got it from 86-DOS which Microsoft purchased the rights to use from Seattle Computer Products in 1980, which in turn implemented \r\n because it was a CP/M clone and CP/M did it that way, and CP/M did it that way because when you've got an 8-bit processor and 16K of RAM, trying to auto-translate \n into \r\n for the printer doesn't make much sense. (And, of course, once you have programs that depend on \r\n being there, backwards compatibility makes that choice hard to change at any point in time.)

    By contrast Unix got the \n convention from Multics, and both Multics and Unix ran from the start on much more powerful machines than CP/M did, so convenience details like auto-translating \n into \r\n on the fly made more sense.

    Don't ask me why Macs versions OS 9 and earlier wanted to use \r as a line ending instead of \n. Luckily that choice is now ancient history and we can all forget about it.