in reply to Re^2: CR-LF Newlines as 2 distinct characters
in thread CR-LF Newlines as 2 distinct characters

I'm pretty sure you need binmode() here, at the very least. If you don't, Windows is going to try to expand LF into CRLF on the way out to disk. That's going to play hell with any attempt on your part to write out your own line-separator.

Another thing I'd try - stop using \n altogether. Instead, write out the characters you want explicitely: "\x012\x013" (or however you write that).

-sam

  • Comment on Re^3: CR-LF Newlines as 2 distinct characters

Replies are listed 'Best First'.
Re^4: CR-LF Newlines as 2 distinct characters
by blogical (Pilgrim) on May 18, 2006 at 21:26 UTC
    Certainly the right track. I had stopped with binmode and gone in search of some way to have the string encoding treated differently, hence my foray into using Encode.pm. As you can see, I've come back to it though.

    "One is enough. If you are acquainted with the principle, what do you care for the myriad instances and applications?"
    - Henry David Thoreau, Walden