in reply to how to recognize windows and linux os

Use the Config module. Sometimes $^O doesn't give you all the details:

C:\>perl -MConfig -e "print $Config{osname},\"\n\";" MSWin32
Alceu Rodrigues de Freitas Junior
---------------------------------
"You have enemies? Good. That means you've stood up for something, sometime in your life." - Sir Winston Churchill

Replies are listed 'Best First'.
Re^2: how to recognize windows and linux os
by Anonymous Monk on Jan 30, 2006 at 14:51 UTC
    'perldoc perlvar'
    $OSNAME $^O The name of the operating system under which this copy of Perl was built, as determined during the configuration process. The value is identical to $Config{'osname'}. See also Config and t +he -V command-line switch documented in perlrun.
      Defining Your Needs

      If you know that your module simply will not run in a certain environment, you should set up prerequisites. These allow you to provide a level of safety for your users. Prerequisites include:

      OSes that your module will not run under

      Check $^O and %Config for this. $^O will tell you the name of the operating system. Sometimes, this isn't specific enough, so you can check %Config.

      use Config; if ( $Config{ osname } ne 'solaris' || $Config{ osver } < 2.9 ) { die "This module needs Solaris 2.9 or higher to run.\n"; }

      Source: http://www.perl.com/lpt/a/2005/04/14/cpan_guidelines.html

      Alceu Rodrigues de Freitas Junior
      ---------------------------------
      "You have enemies? Good. That means you've stood up for something, sometime in your life." - Sir Winston Churchill

      jdporter fixed markup