You can also OS information by the name $OSNAME if you use the English module:
#!/usr/bin/perl
use English qw' -no_match_vars ';
print "$OSNAME\n";
You can also try Perl::OSType module for this kind of problems.
use Perl::OSType ':all';
$current_type = os_type();
Well if you would like to print just the name of OS then Perl is built with a $^O variable that indicates the operating system.
Moreover, If you are interested in more detail then try Config module: