Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Perl module to find os type, version !!!

Posted on 2011-02-16
1
Medium Priority
?
616 Views
Last Modified: 2012-05-11
I know that $^O and $Config{$OSNAME) will give the name of the OS (MSWin32 or Linux), but it is not a complete name. I am looking for a single perl module which can display the complete details like for example:

Windows NT 2000
Windows Server 2008 R2
Windows XP SP2
Mac OSX 10.5
Ubuntu 10.10

Is there is a perl module which can give the complete details like above and simply MSWin32 or Linux, which is what $^O variable outputs?
0
Comment
Question by:imperialguy
1 Comment
 
LVL 27

Accepted Solution

by:
wilcoxon earned 2000 total points
ID: 34911619
The closest module I can find to what you want is Sys::Info::OS but it looks like it is a work-in-progress (the note on CPAN says it currently only supports Windows and Linux).  You could try extending the module yourself.

Otherwise, I think you'll have to write some code specific to each OS (there appear to be quite a few OS-specific modules but they probably have different APIs for getting info).
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question