use Benchmark qw(cmpthese); use List::Util qw(first); @_= ( (0)x1000, 1, (0)x8999 ); cmpthese -1, { func => sub { first { $_ == 1 } @_ }, imper => sub { for ( @_ ) { next unless $_ == 1; return $_ } }, } __END__ Rate imper func imper 518950/s -- -20% func 649177/s 25% --