![]() |
|
go ahead... be a heretic | |
PerlMonks |
Re^3: If any element-in-array comparisionby repellent (Priest) |
on Jan 29, 2012 at 22:39 UTC ( #950669=note: print w/replies, xml ) | Need Help?? |
print "@a\n" if List::Util::first { 0 == $_ } @a When using first as a condition, it's best to wrap it in a defined() to specifically check for the 'not found' case:
OTOH, I agree that first clobbers the predicate when checking for undef -- i.e. we can't tell if we found undef:
In Section
Seekers of Perl Wisdom
|
|