my @all = qw(zero wun two tree fower fife six seven ait niner); my @evens = @all[grep {not $_ % 2} 0..$#all]; #### my @evens = keys %{{@all}};