use strict; use warnings; my @x = (0..$ARGV[0]||1000); my $f = $ARGV[1] || 500; use Benchmark; use List::Util qw(first); Benchmark::timethese(-1, {        Grep => sub{my $y  = grep {$_ == $f} @x},        Util => sub {my $y = first {$_ == $f} @x}    } );