Doozer has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I want to create an if statement where 2 individual variables are matched before action is taken.
To clarify what I want to do, I run a series of tests in different internet browsers on different operating systems. I need to define in my script that when the variable $host matches "MAC" AND the variable $browser matches "Internet Explorer", the script needs to skip the tests because IE does not run on MAC. My first thoughts are it would look something like this:
if ($host =~ /mac/, $browser eq "iexplore") { # skip tests; } else { # run tests as normal; }
I think the above statement is actually an if / or statement though.
Any help would be much appreciated.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help with IF statement for 2 matching conditions.
by Athanasius (Archbishop) on Nov 26, 2012 at 13:22 UTC | |
by Doozer (Scribe) on Nov 26, 2012 at 13:26 UTC | |
by Anonymous Monk on Nov 26, 2012 at 13:37 UTC | |
by gepebril69 (Scribe) on Nov 26, 2012 at 13:57 UTC | |
|
Re: Help with IF statement for 2 matching conditions.
by McA (Priest) on Nov 26, 2012 at 13:21 UTC | |
|
Re: Help with IF statement for 2 matching conditions.
by Anonymous Monk on Nov 26, 2012 at 21:42 UTC | |
by Anonymous Monk on Nov 27, 2012 at 07:50 UTC |