Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: how to quickly tell if number is in an arrayby ioannis (Abbot) |
on Oct 12, 2005 at 04:59 UTC ( [id://499375]=note: print w/replies, xml ) | Need Help?? |
While countless methods exist to test for membership in
the list, it is worthy to remember the obvious: when checking
for elemenet 0, we should not forget to test using
defined. Here is an example, this time using
first from List::Util:
In Section
Seekers of Perl Wisdom
|
|