in reply to If any element-in-array comparision
When the problem description contains the word "any" in the context of a list of items, List::MoreUtils::any seems like an ideal fit.
use List::MoreUtils qw{ any }; print "@array\n" if any { $_ > 0.1 } @array;
I've seen List:Util::first mentioned a couple of times, and agree that will work fine. I recommend List::MoreUtils::any, however, as its meaning and intent is clearer since it has a name that matches the problem.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: If any element-in-array comparision
by mbethke (Hermit) on Jan 27, 2012 at 18:41 UTC | |
by repellent (Priest) on Jan 29, 2012 at 22:39 UTC |