splice @ary, $_, 1 for reverse grep ! $ary[$_] % 2, 0 .. $#ary;
splice @ary, $_, 1 for grep ! $ary[$_] % 2, 0 .. $#ary;
Drat. That'll screw up because all the indexes would be wrong.
In reply to Re: Foreach for array pruning?
by diotalevi
in thread Foreach for array pruning?
by spandox
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |