Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have a IF statement in this form:
if (grep $_ == $F[1],73,89,121,101,117,69,77,67,115,81,97,65,113) {That compares values held within $F1 to those listed. I wish to add an additional condition that checks another variable other than $F1 but i'm struggling somewhat with the syntax and how this will work with the grep. For example:
if (grep $_ == $F[1],73,89,121,101,117,69,77,67,115,81,97,65,113 && $inext eq "Global.SAM")Each condition works individually, but the latter condition testing $inext is ignored when written in this form. Why is this happening and what could be a solution to the problem?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Multiple condition IF statement using grep and eq
by toolic (Bishop) on May 04, 2016 at 17:05 UTC | |
by Anonymous Monk on May 04, 2016 at 17:11 UTC | |
by Marshall (Canon) on May 04, 2016 at 17:23 UTC |