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
In reply to Re^3: What's your programming style?
by kcott
in thread What's your programming style?
by harangzsolt33
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |