Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^4: Print Behavior with Carriage Return

by BillKSmith (Monsignor)
on Jan 06, 2020 at 04:55 UTC ( [id://11111026]=note: print w/replies, xml ) Need Help??


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.)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11111026]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-25 12:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found