Title: Message
This will return the os and if it's windows will give you the version.
 
$os=($^O eq 'MSWin32')?`ver`:$^O; 
 
-----Original Message-----
From: Vladimir Hernandez [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 18, 2002 13:30 PM
To: Perl-Win32-Users
Subject: RE: Finding the OS type
Importance: Low

 
...
But I think he wants to know the OS of the machine he's connecting TO, not the one of the machine he's running the script in, which is what you'll get with this variable, if i'm not mistaken. I don't have an answer to his question tough, and would like to know also!
VH
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Prashanth
Sent: Monday, November 18, 2002 16:03
To: John Drabinowicz; Perl-Win32-Users
Subject: Re: Finding the OS type

The $^O variable contains an indication of the name of the operating system (not its release number) that your perl binary was built for.
----- Original Message -----
Sent: Tuesday, November 19, 2002 1:06 AM
Subject: Finding the OS type

Hi Gang,

so far I have been programming for Win32 (Cygwin) with Perl...

I need to rsh to other machines such as Linux, Solaris, and HP/UX as well as Win32.

Because Win32 is in the mix, I need to find out what type of OS I am connecting to in order to use the corrrect commands i.e. Registry commands or configuration files.

I need to read the correct information from either and translate things correctly for OS independent operation.

Can anyone give me the correct incantations to find the OS type?  Is there any such thing?

Thanks,

John D.

Reply via email to