in reply to Re: Test for OS version in Perl
in thread Test for OS version in Perl
I have a PC that has Cygwin on it (and Perl comes with the Cygwin), and I also have ActivePerl on it. I brought up a Cygwin window, and wrote a little script like this:
#!/usr/bin/perl
#!C:/Perl/bin/perl
print "^O\n";
When I run it like that I get: Cygwin
If switch the two comment lines (so #!C:/Perl... is the first line), I get: MSWin32
What I really want to know is that if I am the running the script from a Cygwin window, regardless of which of those two builds of Perl runs the script, it will tell me I am running in a Cygwin environment. If I run the script from an XP CMD window, I want it to tell me I am running in a windows environment.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Test for OS version in Perl
by xdg (Monsignor) on Oct 20, 2007 at 22:45 UTC | |
by rlambert7 (Acolyte) on Oct 21, 2007 at 01:56 UTC | |
by BrowserUk (Patriarch) on Oct 21, 2007 at 03:10 UTC | |
by xdg (Monsignor) on Oct 21, 2007 at 16:02 UTC | |
by syphilis (Archbishop) on Oct 21, 2007 at 12:54 UTC |