On 10/10/06, Charles Farinella <[EMAIL PROTECTED]> wrote:

How can I iterate through an array and if I find a match do something
without doing that thing for every element in the array.  I've been
trying to do it with foreach, but that isn't working.

It's hard to say for sure why it's not working, without seeing what
you're trying to do. But maybe you want to use the 'last' operator to
exit the foreach once you find a match? 'last' is documented in the
perlfunc manpage.

Hope this helps!

--Tom Phoenix
Stonehenge Perl Training

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to