in reply to Foreach for array pruning?
splice @ary, $_, 1 for reverse grep ! $ary[$_] % 2, 0 .. $#ary; [download]
splice @ary, $_, 1 for grep ! $ary[$_] % 2, 0 .. $#ary; [download]
Drat. That'll screw up because all the indexes would be wrong.