my $f = 50; use Benchmark; use strict; use List::Util qw(first); my @x = (0..$ARGV[0]||1000); Benchmark::timethese(-2, { Grep => sub{my $y  = grep {$_ == $f} @x}, Util => sub {my $y = first {$_ == $f} @x} }); ' 100 Benchmark: running Grep, Util for at least 2 CPU seconds ...      Grep:  2 wallclock secs ( 2.00 usr +  0.00 sys =  2.00 CPU) @ 46457.50/s (n=92915)      Util:  2 wallclock secs ( 2.00 usr +  0.14 sys =  2.14 CPU) @ 76733.18/s (n=164209)