Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

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

by LanX (Bishop)
on Sep 18, 2015 at 23:24 UTC ( #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 (Abbot) 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
Node Status?
node history
Node Type: note [id://1142474]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (2)
As of 2018-02-25 02:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (312 votes). Check out past polls.

    Notices?