another thing.
if you do not need STDERR you can do a dirty trick! ;)
#!/usr/bin/perl -w
use strict;
use warnings;
if ( $^O =~ /^(MS)?Win/ ) {
eval {
#dirty hack to avoid the warning
close STDERR;
require Win32::DriveInfo;
my $TotalNumberOfFreeBytes = (Win32::DriveInfo::DriveSpace('c:
+'))[6];
my $TotalNumberOfBytes = (Win32::DriveInfo::DriveSpace('c:'))[
+5];
print "This is $^O \n";
print "Total Free: $TotalNumberOfFreeBytes\tTotal size: $Total
+NumberOfBytes\n";
};
print $@, "\ndone!";
}
elsif ( $^O =~ /^linux/ ) {
print "This is Linux OS!!!\n";
}
HTH