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

Re^2: What's your programming style?

by Laurent_R (Canon)
on Dec 08, 2018 at 18:55 UTC ( [id://1226975]=note: print w/replies, xml ) Need Help??


in reply to Re: What's your programming style?
in thread What's your programming style?

The document you refer to doesn't seem nor claim to be exhaustive.

I don't have a Mac computer to check that, but it seems from other documents that $^O is equal to the "MacOS" string on a Mac computer (or, at least, it used to be so).

Replies are listed 'Best First'.
Re^3: What's your programming style?
by kcott (Archbishop) on Dec 09, 2018 at 02:36 UTC

    The naming conventions are, at least in my opinion, easily confused. The use of spaces and capitalisation can make a lot of difference.

    For versions where $^O returns MacOS, see perlmacos (that's the most recent online perldoc [for 5.26.1]). Note the versions of Perl where support was dropped and then removed. See perlport (5.8.9) > PLATFORMS > Mac OS for historical information (including use of the ":" separator).

    Mac versions 10.x started roughly 20 years ago. They were originally called "Mac OS X". Around version 10.10 — I don't have exact information to hand — that became "macOS". (I don't know why.) They all use the "/" separator (same as any UNIX-like system).

    I have personal knowledge of versions from 10.7 "Mac OS X" to 10.12 "macOS" (I've used most but not all). To the best of my knowledge, for all of these versions, $^O has always returned darwin.

    $ perl -le 'print $^O' darwin

    Unless support for very old hardware is intended, coding for $^O returning MacOS is probably unnecessary (except, perhaps, for a warning about an unsupported operating system).

    — Ken

      Thank you, Ken, for the clarification. The documents on which I relied were from the year 2000 or so, that's why I prudently concluded my comment with the sentence "or, at least, it used to be so".
Re^3: What's your programming style?
by Your Mother (Archbishop) on Dec 09, 2018 at 04:53 UTC

    Like others have said. It’s been 18 years since Mac started the move from 9 to X (a play on 10, uniX, and neXtstep). 17 years ago X was on all boxes with some dual/system boot options and a couple years after, 9 was gone. I was a dyed in wool Mac fan from the 80s (when all the good typesetting and music software was there) but by 1999 I was within a year of giving up on Mac for some kind of *nix when they made the leap, put out the beta, and I was allowed to remain in their camp.

Re^3: What's your programming style?
by 1nickt (Canon) on Dec 09, 2018 at 01:51 UTC

    Salut, Laurent. Not for a long time has it been like that in my experience. I am on MacOS Sierra, but it's been darwin for as long as I can remember.

    $ perl -E 'say $^O' darwin $ perl -v This is perl 5, version 26, subversion 1 (v5.26.1) built for darwin-2l +evel $ uname -a Darwin MYHOSTNAME 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 21 20:0 +7:39 PDT 2018; root:xnu-3789.73.14~1/RELEASE_X86_64 x86_64

    See Re: Get macOS Version for recent discussion.


    The way forward always starts with a minimal test.

      Does this mean for modern Macs (MacOS) you can simply write Unix-like Perl, including Unix-like path names?

        Yes, because it's a BSD-derived system.

      Thank you, 1nickt, for the clarification.

Log In?
Username:
Password:

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

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

    No recent polls found