Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: How many defaults of $/ does perl have?

by LanX (Saint)
on Sep 18, 2015 at 23:24 UTC ( [id://1142474]=note: print w/replies, xml ) Need Help??


in reply to How many defaults of $/ does perl have?

IIRC "\n" is supposed to work correctly on all OSes.

Perl will do what you mean.

update

See also Re: Carrige Return and Line Feed in Perl.

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

  • Comment on Re: How many defaults of $/ does perl have?

Replies are listed 'Best First'.
Re^2: How many defaults of $/ does perl have?
by stevieb (Canon) on Sep 18, 2015 at 23:35 UTC

    Understood LanX, on Windows, $/ is set to \r\n by default. I've found that on Windows, you can strip \r and be left with an \n (which is expected). I'm curious to know how, where and why this is compiled in. What's the trigger, and are there other *common* possibilities other than \r\n and \n.

      No its not!

      Read the linked post, the IO layer does the translation.

      Mac OS <10 had only "\r".

      Cheers Rolf
      (addicted to the Perl Programming Language and ☆☆☆☆ :)
      Je suis Charlie!

        I posted too quickly, I apologize.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-04-19 02:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found