in reply to Re: Get macOS Version
in thread Get macOS Version
Hi Tux, it looks like there 'osvers' also means 'build version', rather than 'OS version,' and the string that the OP needs ("10.13") is buried in the 'os' value. Of course one could fish it out of there, but in this case I think I prefer the simplicity of a shell call: qx/sw_vers -productVersion/. If the function had to be portable, I might use the module you show, but with the parsing code needed for each OS, it seems like one might as well have conditionally executed shell calls.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Get macOS Version
by Tux (Canon) on Jul 11, 2019 at 12:13 UTC |