|The stupid question is the question not asked
in_array and skipping foreachby webchalkboard (Scribe)
|on Apr 13, 2005 at 14:28 UTC
webchalkboard has asked for the wisdom of the Perl Monks concerning the following question:
Just wondering how can I check if a value exists in an array in Perl? Then if it does, just skip to the next element...
In PHP you can use in_array or something, here is how I would write it long-hand in perl, but there must be a more succinct version as there always is in Perl ;) I don't even think this version will work exactly, as I want the 'next' statement to go to the next value in the outer foreach loop, rather than the one it is in.
Any ideas how I can make this better?