WindowsのOSバージョンの取得


 Win32モジュールのGetOSVersionで取得できます。
use strict;
use warnings;
use Win32;

my ($string, $major, $minor, $build, $id,
    $spmajor, $spminor, $suitemask, $producttype)
    = Win32::GetOSVersion();

print "Major: $major", "\n";
print "Minor: $minor", "\n";
print "Build: $build", "\n";
print "SP   : $spmajor", "\n";
print ['', 'Workstation', 'Domaincontroller', 'Server']->[$producttype], "\n";

関連項目

OS名の取得
WindowsのOS名の取得