At 10:31 -0800 2002.11.12, [EMAIL PROTECTED] wrote: >I'm currently running MacPerl 5.6.1r1 on MacOS 9.2.1. > >I would like to obtain the MacOS version from within >a MacPerl script using the appropriate Mac::API. Can >anyone tell me which one to use? (Didn't see it in >the MacPerl book).
Mac::Gestalt can tell you. use Mac::Gestalt; my $vers = $Gestalt{gestaltSystemVersion()}; # get hex value my @vers = split //, sprintf "%x", $vers; # de-hex # we don't know if there are four digits (10.2.2), or three (9.2.2) printf "%s.%d.%d", join('', @vers[-4, -3]), @vers[-2, -1]; -- Chris Nandor [EMAIL PROTECTED] http://pudge.net/ Open Source Development Network [EMAIL PROTECTED] http://osdn.com/