assuming of course that the indexes are sorted in ascending order. Safer is:
foreach my $i (sort {$b <=> $a} @arrayindex) { splice @array, $i, 1; }
which sorts in descending order thus guaranteeing the indexes are sorted, and removing the need for the reverse.
In reply to Re^2: Remove array elements dynamically! (reverse)
by GrandFather
in thread Remove array elements dynamically!
by newbio
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |