Hi Haukex,

Ok, You are correct in that I did not consider the possibility of an embedded \r.
"Unless you are using binmode, you will never see a <CR>". should be:
"Unless you are using binmode, you will never see a <CR> as part of the line ending".

Your code shows this: "x\ry\r\n" becomes ""x\ry\n". The <CR> associated with the line ending is taken out. This is not a global deletion of just any <CR>. It is a modification of the line ending sequence, just as I said albeit not as perfectly qualified as it could have been.

From reading further info from the OP, it appears that this some kind of strange cygwin issue. I used to have, but no longer have a cygwin installation. cygwin is a weird neither beast nor fowl thing. Once I found out that I couldn't really run SW that used Unix specific features, I got rid of that thing in preference to simply using windows ports of some of the Unix command line utilities.

PS: I did not know if $/ could be set to "\r\n" or not and I said so. I did not give either a "yes" or a "no" answer. You show that it can indeed be set to that. Great to hear that additional info!


In reply to Re^3: How is the default "Input Record Separator" set? by Marshall
in thread How is the default "Input Record Separator" set? by brettasterling

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.