Looks like one too many "}," here: 4 => { 0 => { 1 => 'Windows 95', 2 => 'Windows NT 4.0' }, },
and the close should be after: 90 => { 1 => 'Windows Me' }, So the tested code becomes: my %maj_min_id = ( 3 => { 51 => { 0 => 'Windows NT 3.51' }, }, 4 => { 0 => { 1 => 'Windows 95', 2 => 'Windows NT 4.0' }, 10 => { 1 => 'Windows 98' }, 90 => { 1 => 'Windows Me' }, }, 5 => { 0 => { 2 => 'Windows 2000' }, 1 => { 2 => 'Windows XP' }, 2 => { 2 => 'Windows Server 2003' }, }, ); -- Mike Arms > -----Original Message----- > From: $Bill Luebkert [mailto:[EMAIL PROTECTED] > Sent: Monday, August 18, 2003 11:54 AM > To: Arms, Mike > Cc: [EMAIL PROTECTED] > Subject: Re: Environment variables on Win98 > > > Arms, Mike wrote: > > > Hi, Bill. > > > > Is there a bug in this entry: > > > > 4 => { 0 => { 1 => 'Windows 95' }, > > 10 => { 1 => 'Windows 98' }, > > 90 => { 1 => 'Windows Me' }, > > 0 => { 2 => 'Windows NT 4.0' }, }, > > > > The second "0 =>" effectively wipes out the first. > > So you end up with no entry for Win95. > > Thanks for the catch. Didn't notice the dup when I built the hash. > Try this one: > > my %maj_min_id = ( > 3 => { 51 => { 0 => 'Windows NT 3.51' }, }, > 4 => { 0 => { 1 => 'Windows 95', > 2 => 'Windows NT 4.0' }, }, > 10 => { 1 => 'Windows 98' }, > 90 => { 1 => 'Windows Me' }, > 5 => { 0 => { 2 => 'Windows 2000' }, > 1 => { 2 => 'Windows XP' }, > 2 => { 2 => 'Windows Server 2003' }, }, > ); > > > To see this, add this: > > > > use Data::Dumper; > > print Data::Dumper->Dump( [ \%maj_min_id ], [qw(*maj_min_id)] ); > > > > -- > > Mike Arms > > > > > > > >>-----Original Message----- > >>From: $Bill Luebkert [mailto:[EMAIL PROTECTED] > >>Sent: Friday, August 15, 2003 10:51 PM > >>To: Joe Camel > >>Cc: [EMAIL PROTECTED] > >>Subject: Re: Environment variables on Win98 > >> > >> > >>Joe Camel wrote: > >> > >> > >>>Does anyone know where online I could find out about > >>>env variables on win98? Some of the software I am > >>>supporting contains the following line: > >>> > >>>return unless !defined $ENV{PROMPT} or (defined > >>>$ENV{CMDLINE} and $ENV{CMDLINE}eq 'WIN'); > >>> > >>>The purpose of the return statment is to prevent the > >>>rest of the code from running if the user has a DOS > >>>prompt open already. $ENV{PROMPT} is for XP/2000/NT4, > >>>whereas $ENV{CMDLINE} is suppose to be for WIN 95/98, > >>>but I am not sure if things are working properly since > >>>I don't have a copy of WIN98 handy. Thanks. > >> > >>This may be a more useful method: > >> > >>use strict; > >>my %maj_min_id = ( > >> 3 => { 51 => { 0 => 'Windows NT 3.51' }, }, > >> 4 => { 0 => { 1 => 'Windows 95' }, > >> 10 => { 1 => 'Windows 98' }, > >> 90 => { 1 => 'Windows Me' }, > >> 0 => { 2 => 'Windows NT 4.0' }, }, > >> 5 => { 0 => { 2 => 'Windows 2000' }, > >> 1 => { 2 => 'Windows XP' }, > >> 2 => { 2 => 'Windows Server 2003' }, }, > >>); > >> > >>my ($str, $maj, $min, $bld, $id) = Win32::GetOSVersion(); > >>print "OS Version = $maj_min_id{$maj}{$min}{$id} - $str > Build=$bld\n"; > > > > -- > ,-/- __ _ _ $Bill Luebkert Mailto:[EMAIL PROTECTED] (_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/ -/-' /___/_<_</_</_ http://dbecoll.tripod.com/ (My Perl/Lakers stuff) _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs