5

I want to determine which version of Windows I'm on using POSIX::uname. I know it returns 6.2 on Windows 2012. I found a table of these values, Windows version and corresponding release number but I can't find it anymore. I've been searching the documentation, and I'm not able to run uname on every operating system to test it right now. Does anyone have a link or know which numbers correspond to which version of Windows?

http://perldoc.perl.org/perlport.html

http://perldoc.perl.org/POSIX.html

ikegami
  • 367,544
  • 15
  • 269
  • 518
hmatt1
  • 4,939
  • 3
  • 30
  • 51

1 Answers1

6

On Windows, POSIX::uname obtains its information from GetVersionEx whose parameter's documentation contains a table.

The Win32 module provides more user-friendly calls.

>perl -MWin32 -E"say Win32::GetOSDisplayName()"
Windows 7 Professional (64-bit) Service Pack 1
ikegami
  • 367,544
  • 15
  • 269
  • 518