for my $i (grep 0 == $_ % 2, 0 .. 40) { my @e = ($i, $i + 1); push @f, \@e; }