Re: help on searching an array

2002-03-27 Thread Adam Wesselink
I'd split up the foreach loop and the conditional it might be a little clunky, but here's the basic idea. bolFound = false foreach (@members) { if (/($enqmem)/i) { bolFound = true; } } if (bolFound) { do stuff } else { do other stuff } At 18:54 27-03-02 +

RE: help on searching an array

2002-03-27 Thread Timothy Johnson
Here's one way. Instead of printing out the confirmation right away, I stored a 1 in the $ismem variable if one of the matches was true. Then I used it later to check if any of the names had matched. Another way would be to use a hash instead of an array so that you can check the index against

RE: help on searching an array

2002-03-27 Thread Nikola Janceski
You got the wrong algorithm. Try doing it with grep. perldoc -f grep foreach (@members) { if ( grep { #put your test/check here } @members ){ # they are a member } else { # they aren't } } > -Original Message- > From: Wytch