in reply to How to know the Windows OS that perl is running on

perlvar does give some additional clues:

$OSNAME

$^O

The name of the operating system under which this copy of Perl was built, as determined during the configuration process. For examples see PLATFORMS in perlport.

The value is identical to $Config{'osname'} . See also Config and the -V command-line switch documented in perlrun.

In Windows platforms, $^O is not very helpful: since it is always MSWin32 , it doesn't tell the difference between 95/98/ME/NT/2000/XP/CE/.NET. Use Win32::GetOSName() or Win32::GetOSVersion() (see Win32 and perlport) to distinguish between the variants.

In other words...... use Win32 and specifically either GetOSName() or GetOSVersion() (depending on what you're looking for).


Dave

  • Comment on Re: How to know the Windows OS that perl is running on

Replies are listed 'Best First'.
Re^2: How to know the Windows OS that perl is running on
by alain_desilets (Beadle) on Apr 29, 2011 at 20:48 UTC
    THx, that does the trick.