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

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

Replies are listed 'Best First'.
Re^4: What's your programming style?
by Laurent_R (Canon) on Dec 09, 2018 at 10:29 UTC
    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".