in reply to Remove array elements dynamically!
Just do it from the back.
foreach my $i (reverse @arrayindex) { splice @array, $i, 1; }
lodin
Update: This assumes sorted indexes. See GrandFather's note if they're not sorted.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Remove array elements dynamically! (reverse)
by GrandFather (Saint) on Aug 27, 2007 at 21:02 UTC | |
by lodin (Hermit) on Aug 27, 2007 at 23:11 UTC | |
by GrandFather (Saint) on Aug 27, 2007 at 23:20 UTC |