![]() |
|
go ahead... be a heretic | |
PerlMonks |
Re: Answer: How to find out if X is an element in an array?by NetWallah (Canon) |
on Sep 10, 2003 at 06:29 UTC ( #290319=note: print w/replies, xml ) | Need Help?? |
Hmm - This method will not scale well because it creates a temporary hash. If this is a repeated search in a large array, you would be doing a lot of memory management.
Here is the equivalent code, using grep: The "scalar" isnt really necessary, but it documents the fact that grep is called in a scalar context.
In Section
Seekers of Perl Wisdom
|
|