Code used: #!/usr/bin/perl use Time::HiRes qw(gettimeofday tv_interval ); use strict; # good habits start at birth my ($start,$stop); my @moo; @moo = (1 .. 1000000); $start = [gettimeofday()]; @moo = grep {; {if ($_ % 2 > 0){ 0;last; } 1;}} @moo; $stop = [gettimeofday()]; print tv_interval($start, $stop), "\n\n";