Re: Forcing list context on <$fh>
- From: Tim Greer <tim@xxxxxxxxxxxxx>
- Date: Sat, 28 Feb 2009 18:07:13 -0800
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!
.
- References:
- Re: Forcing list context on <$fh>
- From: sln
- Re: Forcing list context on <$fh>
- Prev by Date: FAQ 8.34 I {changed directory, modified my environment} in a perl script. How come the change disappeared when I exited the script? How do I get my changes to be visible?
- Next by Date: Re: I'm UNEMPLOYED with no job prospects. Please post your Perl homework, any work that you can't do.
- Previous by thread: Re: Forcing list context on <$fh>
- Next by thread: Re: Forcing list context on <$fh>
- Index(es):
Relevant Pages
|