Usually, I when I expect to need to check for the presence of something in an array, I code it with a hash from the start. Hard to beat O(1) efficency.
----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
Note: All code is untested, unless otherwise stated
In reply to Re: Checking a string's presence within an array.
by hardburn
in thread Checking a string's presence within an array.
by antirice
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |