Determine version of Microsoft Windows using perl?
问题 I am creating a small perl script on Windows. I want to determine the version of Windows i.e. XP, Vista, 7, 8, etc. How can I get this information? Thank You. UPDATE: I want to know the Version of Windows on which the script is running! Please add some code on how to use the API's as I am a beginner & dont know much about perl. 回答1: Try Win32: #!/usr/bin/env perl use 5.014; use strict; use warnings; use Win32; say Win32::GetOSDisplayName(); say for Win32::GetOSName(); say for Win32: