Your skill will accomplish what the force of many cannot |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
First of all: You can use loop labels to controll which loop a next or last pertains to:
But to actually answer your question: I think it would be better to use grep in a scalar context to test for the presence of an item in an array (as opposed to foreach'ing through the array doing an eq comparison).
HTH. Cheers Update: As others have suggested, a hash is better for this type of lookup A truely compassionate attitude towards other does not change, even if they behave negatively or hurt you His Holiness, The Dalai Lama In reply to Re: in_array and skipping foreach
by JediWizard
|
|