|
|
| The stupid question is the question not asked | |
| PerlMonks |
Re^2: How to check whether my array contains element xby Your Mother (Canon) |
| on Jan 17, 2013 at 20:26 UTC ( #1013883=note: print w/ replies, xml ) | Need Help?? |
|
What they already said except that since you're not actually using regex, you shouldn't use regex. This will be faster and have fewer caveats (I inverted the statement as a matter of stylistic preference, not because it's necessary)– print "Found it.\n" if grep { $_ eq $value } @array;
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||