At 01:46 AM 6/24/05 -0700, $Bill Luebkert wrote:
>Don't need the binmode on the output file unless you want to remove \r's.

Just using binmode in debug environment to prevent implicit newline
translations.


>The line count insertion was my request so he could compare
>what was a line and what wasn't - not needed.

Ugh.  I spent so much time on that! :D


>\n is indeed a character.  It's a linefeed/newline character.
>It's the underlying OS that adds the CR/\r in front of the
>LF/\n when in text mode.

Within a certain context it is ^J.  From O'Reilly: "All systems use the
virtual "\n" to represent a line terminator, called a newline. There is no
such thing as a newline character. It is an illusion that the operating
system, device drivers, C libraries, and Perl all conspire to preserve.
Sometimes, this changes the number of characters in the strings you read and
write. "  So you can never absolutely say what a \n is unless u first define
what context ur in.  It just so happens that usually this is the context
where \n eq ^J.


>My philosophy would be to never use a \r ever when coding
>output (except to overwrite a line).  To cleanup a bad file

The only time I normally use a \r is when I want to output a DOS format file
on Unix.


Some more O'Reilly: "On a Mac, a "\n" is usually represented by "\cM"; just
to make life interesting (and because the standard requires that "\n" and
"\r" be different), a "\r" represents a "\cJ". This is exactly the opposite
of the way that Unix, Plan9, VMS, CP/M, or nearly anyone else does it. So,
Mac programmers writing files for other systems or talking over a network
have to be careful. If you send out "\n", you'll deliver a "\cM", and no
"\cJ" will be seen. Most network services prefer to receive and send
"\cM\cJ" as a line terminator, but most accept merely a "\cJ"."

Pity.







--
REMEMBER THE WORLD TRADE CENTER         ---=< WTC 911 >=--
"...ne cede males"

00000100

_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to