use strict; use warnings; use Benchmark qw(cmpthese); use List::Util 1.35 (); BEGIN { *any_lu = *List::Util::any }; use List::MoreUtils (); BEGIN { *any_lmu = *List::MoreUtils::any }; sub any_pp (&@) { my $code = shift; &$code and return 1 for @_ ; () } { no warnings 'once'; @::LIST = (0..9); $::TARGET = 5; } cmpthese(-1, { any_lu => q[ any_lu { $_ eq $::TARGET } @::LIST ], any_lmu => q[ any_lmu { $_ eq $::TARGET } @::LIST ], any_pp => q[ any_pp { $_ eq $::TARGET } @::LIST ], }); __END__ Rate any_pp any_lmu any_lu any_pp 65761/s -- -79% -80% any_lmu 309688/s 371% -- -5% any_lu 324588/s 394% 5% --