Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: How to print Unix newlines in Strawberry Perl on Windows

by BrowserUk (Pope)
on Feb 20, 2013 at 12:42 UTC ( #1019777=note: print w/ replies, xml ) Need Help??


in reply to How to print Unix newlines in Strawberry Perl on Windows

In order to write Unix line ending, simply binmode the file after opening and before use and do the 'normal' thing of using "\n" for your line endings.

There are other ways involving explicitly 'popping' the :crlf IOLayer when opening the file, but it isn't documented properly and I cannot remember how to do it.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re: How to print Unix newlines in Strawberry Perl on Windows
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (13)
As of 2014-10-31 18:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (223 votes), past polls