Recent Perl versions have the ability to delete array indexes as one would delete hash elements.
Please note, however, this operation leaves undef entries unless items are deleted from the end of the array.my @a = 1..10; for my $i (0 .. 9) { delete $a[$i] if $a[$i] % 2; }
In reply to Re: Foreach for array pruning?
by pbeckingham
in thread Foreach for array pruning?
by spandox
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |