If you don't have any, it is easy to implement it using the reduce function of List::Utils with something like this:
sub any {
my $code_ref = shift;
reduce { $a or $code_ref->(local $_ = $b) } @_;
}
Or, better:
sub any(&@) {
my $code_ref = shift;
reduce { $a or $code_ref->(local $_ = $b) } @_;
}
which makes it possible to call it with a syntax similar to grep:
<strike>print "true\n" if any { $_> 11 } qw /3 12 4 5 7/; # prints tru
+e
Update: the above line need to be this:
print "true\n" if any { $_> 11 } 0, qw /3 12 4 5 7/; # prints true
|