# ******************************************************** # OS.pl # for Perl scripts that need to know the OS # (c)2000,2003 Soren Andersen # This program is Free Software, it may be used, modified # and redistributed under the same terms as Perl itself. # L/M: Friday Aug 01 2003 # ******************************************************** sub IsNotWin { if ($^O and $^O !~ /WIN32/i) { return 1; } elsif ($^O and $^O =~ /WIN32/i) { return 0; } elsif (eval ('require ("Win32")') ) { return 0; } return 1; } 1; __END__ =head1 NAME OS.pl =head1 SYNOPSIS Here is one way to use this: BEGIN { require ("OS.pl"); if &IsNotWin { print STDERR "Sorry! This script does not run yet ". "on anything but 32-bit Windows, and ". "you are using $^O\n"; sleep(3); die; } } =head1 AUTHOR =over 8 Soren Andersen somian -AT- cpan -DOT- org =for html

=cut