foreach my $i (reverse @arrayindex) { splice @array, $i, 1; }