Re: Trouble with printing newlines to a file



On 2007-05-13 13:36, Dr.Ruud <rvtol+news@xxxxxxxxxxxx> wrote:
A. Sinan Unur schreef:
Also, if one wants specific characters, it is better to specify them
by their codes rather than using \n whose meaning depends on what the
platform thinks a line ending ought to be.


Using either "\n" of chr(10) or "\x0A" or "\x{0A}" or "\012" or "\cJ"
(etc.) seems to make no difference (on Windows, have not tested OS-X).

Yes, "\n" is the same as "\x0A" on Windows. I think it's the same on
MacOS X, but it was "\x0D" on MacOS <= 9.

I don't know what EBCDIC-based versions of perl use: NL ("\x15") is
probably more natural than LF ("\x25") there.

hp


--
_ | Peter J. Holzer | I know I'd be respectful of a pirate
|_|_) | Sysadmin WSR | with an emu on his shoulder.
| | | hjp@xxxxxx |
__/ | http://www.hjp.at/ | -- Sam in "Freefall"
.



Relevant Pages

  • Re: Trouble with printing newlines to a file
    ... by their codes rather than using \n whose meaning depends on what the ... platform thinks a line ending ought to be. ...
    (comp.lang.perl.misc)
  • Re: Im really not understanding this paragraph in perldoc -f open
    ... name) then LIST becomes arguments to the command ... invoked if the platform supports it. ... give extra LIST arguments meaning. ... on platforms that don't support true fork. ...
    (comp.lang.perl.misc)
  • Re: What is "marshal" in programming context?
    ... supports both Unix and Windows platform. ... it is the same meaning as in Windows or not. ... converting a primitive type to an Object type and back. ... I am more familiar with the meaning associated with serialising data ...
    (comp.programming)
  • Re: Photo policy?????
    ... >>As long as you realise that a railway station platform is not a public ... >>place, and neither is a shopping mall, I see no reason to disagree. ... "Public place" has a specific legal meaning. ...
    (uk.railway)
  • Re: How to know that stack is growing upward/downward?
    ... I've seen a lot of posts recently (recently, meaning within the last ... platform is) questions like "How can I tell which way the stack goes" or "I ... virus technique - they send you an email with an attachment that consists ...
    (comp.lang.c)