Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: 3 questions... 2 about newlines, and one on how to be NICE

by nothingmuch (Priest)
on Jan 11, 2005 at 23:09 UTC ( #421457=note: print w/ replies, xml ) Need Help??


in reply to 3 questions... 2 about newlines, and one on how to be NICE

In windows (and other CRLF platforms), not only can $/ be changed, but the meaning of \n can too.

There are two types of input streams, on windows... Text, and binary (ftp suffers from this atrocity too...).

if you open a file it's normally considered a text file, and printing "\n" into it will result in a CRLF. However, if you binmode FILEHANDLE, then printing "\n" will result in LF, and "\r" will result in CR.

Scary, huh?

-nuffin
zz zZ Z Z #!perl


Comment on Re: 3 questions... 2 about newlines, and one on how to be NICE
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2015-07-05 03:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls