geo has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
I am looking for a way to determine the Windows Edition (XP, Vista, Windows 7) of the system running a Perl script.
The variable $^O returns the os name but I need a bit more information. If this has been discussed previously, a pointer would be great as I could not find any thread on this subject.
Thanks
geo
Re: How to determine Windows Edition
by BrowserUk (Patriarch) on Apr 22, 2010 at 00:51 UTC
|
C:\test>perl -MWin32 -E" say Win32::GetOSName()"
WinVistaService Pack 1
C:\test>perl -E" say Win32::GetOSVersion()"
Service Pack 16060012107681
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] |
|
I like it! Thanks for the (very) quick response
| [reply] |
Re: How to determine Windows Edition
by Burak (Chaplain) on Apr 22, 2010 at 14:31 UTC
|
You can also try my Sys::Info module for a more detailed information:
use Sys::Info;
print Sys::Info->os->name( edition => 1, long => 1 );
Sample output: Windows Vista Home Premium Edition Service Pack 2 build 6002 | [reply] [d/l] |
|