Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

by Athanasius (Monsignor)
on Feb 20, 2013 at 12:25 UTC ( #1019773=note: print w/ replies, xml ) Need Help??


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

$/ is the input record separator. The output record separator is $\. See The parable of the falling droplet.

Also, the default value of $\ is undef (meaning that nothing will be automatically appended to each printed line). If you set $\ as shown, you should omit the trailing "\n":

{ local $\ = "\r\n"; print "Win/DOS line ending"; }

— otherwise, you will get "\n\r\n" printed at the end of the string.

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,


Comment on Re^2: How to print Unix newlines in Strawberry Perl on Windows
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (13)
As of 2014-09-02 16:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (25 votes), past polls