in reply to Remove array elements dynamically!

Another approach is to create a complementary index, then take the array slice.
my @keep = (0..$#array); $keep[$_] = undef for (@arrayindex); @array = @array[grep {defined $_} @keep];