in reply to Re^3: Print Behavior with Carriage Return
in thread Print Behavior with Carriage Return

Yes, :crlf processes unix style files correctly, but for the wrong reason. (It does not translate Unix record separators, it fails to recognize them at all. This works because the Unix record separator and the perl newline are the same character.) I find this misleading, and recommend against it.
Bill
  • Comment on Re^4: Print Behavior with Carriage Return

Replies are listed 'Best First'.
Re^5: Print Behavior with Carriage Return
by haukex (Archbishop) on Jan 06, 2020 at 10:53 UTC
    Yes, :crlf processes unix style files correctly, but for the wrong reason. (It does not translate Unix record separators, it fails to recognize them at all.

    I still don't quite follow - AFAIK, on *NIX, Perl's "logical" \n is always LF, so I don't really see any problems if it's just CRLF vs. LF files and only Windows and *NIX are involved; if there are other OSes or formats involved, then one might indeed run into issues there. But of course I'd also advise to always know one's input format (that gets especially important when Unicode is involved), so knowing whether one's input is CRLF vs. LF is a good recommendation of course. (In this particular case I think the :crlf layer gives more flexibility over input formats.)