[Date Prev][Date Next][Thread Prev][Thread Next]
[Search]
[Date Index]
[Thread Index]
Re: [FWP] japh
On Wed, 14 Feb 2001 at 11:47:07 -0500, Ronald J Kimball wrote:
> \x0d is a carriage return, aka \r. It means 'return to the beginning of
> the current line'.
> Windows uses \r\n as a line terminator, whereas Unix uses \n.
Nitpick: no, from Perl every system uses "\n". But on MSDOS (aka Windows :-)
it's "\0xa\0xd", on Mac it's "\0xd" and on Unix "\0xa". Problems start
when you transfer text files in binary mode from one to another.
ObFWP:
$_="Js nte elhce,\rutaohrPr akr";s/./$&\e[C/g;print;
(works on ANSI terminals at least)
Obreminicence:
As a a sometime user of an ASR33 (aka "teletype") there's a very good
reason for the CR/LF pair. The CR was sent first, and started the print
head moving. Then the LF, which advanced the platen. The CR motion took
longer, so needed a "dead" character after it. Unless you wanted to
overprint, CR-LF did fine. Otherwise you sent CR-NUL.
The decision to use CR+LF as the standard internet line-end is a
puzzling one...
Ian
==== Want to unsubscribe from Fun With Perl? Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
==== unsubscribe
- References:
- [FWP] japh
- From: Joey Mitchell Comeau <aw096@chebucto.ns.ca>
- Re: [FWP] japh
- From: Ronald J Kimball <rjk@linguist.thayer.dartmouth.edu>