Hi All,
I am trying to see if the Windows version I am using is newer than Windows 7 or Windows Server 2008 R2 (minimum requirements). I googled a bit and run into your post. Here is my question, I am running on Windows 10 machine and these lines:

print ("(\$ENV{\"OS\"}: " . ($ENV{"OS"}) . "\n"); use Win32; print "GetOSName: " . Win32::GetOSName() . "\n"; use Config; print "$Config{osname}\n"; print "$Config{archname}\n"; print "$Config{osvers}\n"; my ($name, $major, $minor, $build, $id) = Win32::GetOSVersion(); my %versions = ( 0 => {'' => {'' => "Win32s"}}, 1 => { 4 => { 0 => "Windows 95", 10 => "Windows 98", 90 => "Windows Me" } }, 2 => { 3 => {51 => "Windows NT 3.51"}, 4 => {0 => "Windows NT 4"}, 5 => { 0 => "Windows 2000", 1 => "Windows XP", 2 => "Windows Server 2003" }, 6 => { 0 => "Windows Vista or Server 2008", 1 => "Windows 7" } }, ); print "version: " . $id . ", " . $major . "," . $minor . "\n";
yields me:
($ENV{"OS"}: Windows_NT GetOSName: Win2003 MSWin32 MSWin32-x86-multi-thread 4.0 version: 2, 6,2
My questions are:
1) How can I see it is windows 10? Why do I receive "Windows_NT" and "Windows2003" in my first two lines?
2) @marto why do I get the version to be 4.0?
3) @GrandFather, I looked into the link you posted http://search.cpan.org/~jdb/Win32-0.52/Win32.pm, but all I see there is a table of:
OS ID MAJOR MINOR Win32s 0 - - Windows 95 1 4 0 Windows 98 1 4 10 Windows Me 1 4 90 Windows NT 3.51 2 3 51 Windows NT 4 2 4 0 Windows 2000 2 5 0 Windows XP 2 5 1 Windows Server 2003 2 5 2 Windows Server 2003 R2 2 5 2 Windows Home Server 2 5 2 Windows Vista 2 6 0 Windows Server 2008 2 6 0 Windows 7 2 6 1 Windows Server 2008 R2 2 6 1 Windows 8 2 6 2 Windows Server 2012 2 6 2
Where is Windows 10, 2016 and other which are newer (regular/server) from the requirement I wrote?

In reply to Re: Get version of installed OS by borodache
in thread Get version of installed OS by bimleshsharma

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.