or download this
my $OS;
if ($^O =~ /mswin/i) {$OS = "Windows";print "OS detected: Windows\n"}
elsif ($^O =~ /linux/i) {$OS = "Linux";print "OS detected: Linux\n"}
...
chomp ($OS = <STDIN>);
print "\nIncorrect OS type. Try again.\n\n" unless $OS eq "Windows" or
+ $OS eq "Mac" or $OS eq "Linux";} until ($OS eq "Windows" or $OS eq "
+Mac" or $OS eq "Linux");
}