Hi monks,

I am having trouble getting the OS NT, Vista and Windows 7

This is how a portion of my code looks

($string, $major, $minor, $osbuild, $id) = Win32::GetOSVersion (); $os = ""; if ($DEBUG >= 2) { print "ID = $id\n"; } if ($id == 0) { print "Unable to determine win32s!"; } $os = { 1 => { 0 => "95", 10 => "98", 90 => "Me" }, 2 => { 0 => "2000", 1 => "XP/.Net", 2 => "Server 2003", 51 => "NT3.51" } }->{$id}->{$minor};

how can i get Oses NT 4 and Vista when they have the same minor and id with 2000, Also does the functionality supports Windows 7 OS?

second problem is i have to split the result into two. I need to compare the result to update a file to all Oses under $major <= 4, While the other split will depend on $major >=5 in which a different file is processed for the remaning Oses

Im really confused of what flow i have to implement. much thanks


In reply to split OSVersion in two categories by nico7nibor

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.