Determine OS and then adding module
#############
#!/usr/bin/perl
use POSIX qw(uname);
my $kernel = (uname)[0];
if ( ! $kernel =~ m/^Windows/) {
use Sun::Solaris::Kstat;
}
##############
i want to use a module by making sure its available first. Can somebody tell how to do that.
I am getting an error doing that as above
---------- Capture Output ----------
> "D:\Perl\bin\perl.exe" filename.pl
Can't locate Sun/Solaris/Kstat.pm in @INC (@INC contains: D:/Perl/lib D:/Perl/site/lib .) at ups3.pl line 13.
BEGIN failed--compilation aborted at ups3.pl line 13.
> Terminated with exit code 2.