in reply to Foreach for array pruning?

Recent Perl versions have the ability to delete array indexes as one would delete hash elements.

my @a = 1..10; for my $i (0 .. 9) { delete $a[$i] if $a[$i] % 2; }
Please note, however, this operation leaves undef entries unless items are deleted from the end of the array.