Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
It appears to be some kind of Windows family ID. The actual value appears to be meaningless, since WinCE definitely isn't of a higher level than Windows XP, for example.

I interpret it as follows:
0Windows 3.1, 3.11, WFWThe 16 bit Windows generation
1Win95/98/MEWin95 and descendants
2WinNT3.x, WinNT4.x, Win2k, WinXPthe NT family
3WinCEWindows 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

In reply to Re: perlport, MSWin32 and ID column by bart
in thread perlport, MSWin32 and ID column by giulienk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2021-05-18 12:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (178 votes). Check out past polls.

    Notices?