Galen has asked for the wisdom of the Perl Monks concerning the following question:
What I'd like to do is check each element of @tmp one by one, and if it meets a conditionA, move on and begin looking at the next element of the array. This isn't working, however. I get the conditionB check whether or not conditionA is met. Thanks in advance - I know this is probably a stupid question.foreach(@tmp) { if (conditionA) { next; } elsif (conditionB) { &do_something; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: loop control
by dsheroh (Monsignor) on May 22, 2002 at 14:39 UTC | |
by Galen (Beadle) on May 22, 2002 at 14:56 UTC | |
by hotshot (Prior) on May 22, 2002 at 15:08 UTC | |
by dsheroh (Monsignor) on May 22, 2002 at 15:09 UTC | |
by Galen (Beadle) on May 22, 2002 at 17:34 UTC | |
|
Re: loop control
by broquaint (Abbot) on May 22, 2002 at 14:43 UTC | |
by Galen (Beadle) on May 22, 2002 at 17:48 UTC | |
|
Re: loop control
by hotshot (Prior) on May 22, 2002 at 14:34 UTC |