Re: Detecting OS X version from perl

[email protected] (Eberhard Lisse)
Newsgroups perl.macosx
Organization Dr Eberhard W Lisse
Message-ID <[email protected]>
Very Cool,

on my iMini

Gestalt says it's 10.4.9
osascript/fider says 10.4.7
sw_version 10.4.11

the latter is correct :-)-O

on 10/16/07 2:52 AM Chris Nandor said the following:
> In article <[email protected]>,
>  [email protected] (David Cantrell) wrote:
> 
>> Is there any simple way that people can think of to detect which major
>> version of OS X my perl code is running on?
>>
>> ie whether it's 10.0, 10.1 etc, I don't care about the difference
>> between 10.3.3 and 10.3.4.
> 
> This is nice in that it doesn't depend on external processes (sw_vers, 
> Finder) or files.
> 
>    use Mac::Gestalt qw(%Gestalt gestaltSystemVersion);
>    (my $version = sprintf("%x", $Gestalt{gestaltSystemVersion()})) =~
>       s/^(\d+)(\d)(\d)$/$1.$2.$3/;
> 


-- 
If you want to email me, replace nospam with el
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.