> > Well, you're right that List::MoreUtils is not core and List::Util is.
> > However, why is "first" preferable over "any"? I think "any" would be
> > preferable here, because we're not interested in the first item that
> > matches, just if it exists. And "any" probably short-circuits.
Yes it does, so you are, as always, right.
sub any (&@) {
my $f = shift;
return if ! @_;
for (@_) {
return 1 if $f->();
}
return 0;
}
Ran
--
Ran Eilam [EMAIL PROTECTED]
_______________________________________________
Perl mailing list
[email protected]
http://perl.org.il/mailman/listinfo/perl