Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Get version of installed OS

by marto (Archbishop)
on Nov 22, 2012 at 11:25 UTC ( #1005108=note: print w/replies, xml ) Need Help??

in reply to Get version of installed OS

Perhaps this does what you want, it uses Config which is core. Tested on Windows, Solaris and netbsd:

#!/usr/bin/perl use strict; use warnings; use Config; print "$Config{osname}\n"; print "$Config{archname}\n"; print "$Config{osvers}\n";


MSWin32 MSWin32-x86-multi-thread 5.1

Replies are listed 'Best First'.
Re^2: Get version of installed OS
by bimleshsharma (Beadle) on Nov 22, 2012 at 11:31 UTC

    Thanks.... One another way to get specially for windows is

    my $osname = Win32::GetOSName(); my ( $osvername, $major, $minor, $id ) = Win32::GetOSVersion(); print "osname: $osname\n"; print "osvername: $osvername\n"; print "major: $major\n"; print "minor: $minor\n"; print "id: $id\n";

      True, though you didn't specify which OS you were using when you posted the question ;)

      Update: I see you've just changed your question to specify OS. It'd make more sense if you'd posted that as an update to your post, like I've done here.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1005108]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2018-06-21 10:24 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (118 votes). Check out past polls.