in reply to perlport, MSWin32 and ID column
I interpret it as follows:
0 | Windows 3.1, 3.11, WFW | The 16 bit Windows generation |
1 | Win95/98/ME | Win95 and descendants |
2 | WinNT3.x, WinNT4.x, Win2k, WinXP | the NT family |
3 | WinCE | Windows Control Edition, for handheld devices. |
I can't say I can even find a trace of it in Config.pm, nor in the \%Config hash it creates. I wouldn't trust those values anyway, as they are likely the values at the time perl was compiled. For example, on my system, $Config{osversion} is '4.0', even though I'm on Win98. As you can see, I should have gotten '4.1' or '4.10'.
I think using an API call, through Win32::API, would be the safest way. As for which API call... there is GetVersion(). You'll get the value of the last column, live this time, and at least one bit saying whether this is NT or not. But still, GetVersionEx() looks like the better choice.
use Win32::API; my $tpl = 'V5Z128'; my $struc = pack $tpl, 5*4+128, (0) x 4, ''; my $GetVersionEx = new Win32::API('kernel32', 'GetVersionExA', ['P'], +'N'); $GetVersionEx->Call($struc); my($OSVersionInfoSize, $MajorVersion, $MinorVersion, $BuildNumber, $Pl +atformId, $CSDVersion) = unpack $tpl, $struc; print << "END"; major: $MajorVersion minor: $MinorVersion build: $BuildNumber platform: $PlatformId "$CSDVersion" END
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: perlport, MSWin32 and ID column
by Anonymous Monk on Feb 25, 2003 at 14:24 UTC |