You can use the special variable $^O to see what your script is running upon:
#!/usr/bin/perl -w use strict; print "This is : $^O \n"; if ( $^O =~ /win/i ) { print "Looks like Windows\n"; } if ( $^O =~ /linux/i ) { print "Looks like Linux\n"; }
(Note: That is "capital o", not "zero".)
In reply to Re: How to know what os the program is running
by skx
in thread How to know what os the program is running
by xuepengduan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |