Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by Athanasius (Abbot)
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 scrutinizing the Monastery: (8)
As of 2015-07-08 03:53 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 (94 votes), past polls