Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: Native newline encoding

by Your Mother (Chancellor)
on May 23, 2012 at 01:12 UTC ( #971921=note: print w/replies, xml ) Need Help??


in reply to Re^2: Native newline encoding
in thread Native newline encoding

…result is the same on a *nix system…

You mean like a Mac? :P

perl -le 'open F,">",\$f; {local($/,$\); print F "\n"}; print unpack " +H*", $f' 0a

Replies are listed 'Best First'.
Re^4: Native newline encoding
by AnomalousMonk (Canon) on May 23, 2012 at 03:41 UTC

    I'm not at all familiar with the Mac, but I had always heard/understood that it used 0x0d as the underlying OS-mumble-nix file system newline delimiter. No? (But that is separate and apart from the code experiments that have been done in this thread, since I suspect the delimiter is always 0x0a for Perl internally.)

      Mac has been a BSD / NeXTSTEP Unix variant called Darwin under the hood starting c 2000. I suspect some of its files/dev-UI may still use or default to legacy encoding schemes but so far I have been mercifully spared from needing to know.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://971921]
help
Chatterbox?
[LanX]: it's up to the Supreme commander
[GotToBTru]: we don't have one of those ;)
[LanX]: commander in chief whatever
Discipulus fears to ears this in German..
[LanX]: missing for month

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (11)
As of 2017-01-20 12:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (174 votes). Check out past polls.