I think I found that "perlvar", and I saw that $^O, but I didn't think it would give me what I want. After thinking about it, I guess it would work in most cases, but not in my specific case.
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.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.