Re: Forcing list context on <$fh>



sln@xxxxxxxxxxxxxxx wrote:

On Sat, 28 Feb 2009 11:30:38 -0800, Tim Greer <tim@xxxxxxxxxxxxx>
wrote:

Gunnar Hjalmarsson wrote:

Gunnar Hjalmarsson wrote:
I thought that \n means \015\012 on Windows. Now - after having
re-read your comments, re-read the "Newlines" section in "perldoc
perlport", and played around some more - I'm slowly realizing that
it means \012 just as on *nix, and that the \015\012 newline is
only used on *saved* text files.

Second thought. Please read this extract from "perldoc perlport":

"Perl uses \n to represent the "logical" newline, where what is
logical may depend on the platform in use. In MacPerl, \n always
means \015. In DOSish perls, \n usually means \012, but when
accessing a file in "text" mode, STDIO translates it to (or from)
\015\012, depending on whether you're reading or writing."

Doesn't it say that STDIO changes the meaning of \n on Windows? But
that is not correct, is it? Or am I still missing something?


I thought it meant that it changes it so reading \015\012 would
translate it to \n, and writing it would change it from \n to
\015\012.
It's been a _long time_ since I've used Windows. Maybe run a couple
of quick tests to verify and see exactly what it's doing (to avoid any
confusion), and then you'll know.

Why don't you create a binary file in windows and insert 10 or 13 on a
few lines (but not both), then the pair in a few (reverse a few too),
then check the results.

Or, dial up Wally and ask him.

-sln

Who are you talking to? Who's using Windows? Who's creating a binary
file and needs to do that test? Were you replying to Gunnar?
--
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting. 24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!
.



Relevant Pages

  • Re: Forcing list context on <$fh>
    ... Please read this extract from "perldoc perlport": ... "Perl uses \n to represent the "logical" newline, ... Doesn't it say that STDIO changes the meaning of \n on Windows? ... It's been a _long time_ since I've used Windows. ...
    (comp.lang.perl.misc)
  • Re: Forcing list context on <$fh>
    ... Please read this extract from "perldoc perlport": ... "Perl uses \n to represent the "logical" newline, ... Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers ...
    (comp.lang.perl.misc)
  • Re: Forcing list context on <$fh>
    ... Please read this extract from "perldoc perlport": ... "Perl uses \n to represent the "logical" newline, ... Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers ...
    (comp.lang.perl.misc)
  • Re: Absolute Novice (Mac Tiger) Needs Help
    ... MacOS X is so newlines are linefeeds ... Windows didn't do the same because line the termination is two characters ... the meaning of \n and \r remain the ... to believe it until I can test it on a dodgy newline system such as ...
    (comp.lang.perl.misc)
  • Re: Recommended Windows Hosts
    ... I've been very pleased with my hosting company, ... You never weighed-in with any recommended hosts for Windows Servers. ... Some of them are ASP or ASP.NET ...
    (microsoft.public.frontpage.client)