in reply to delete an element from an array

To answer the question asked, you can use splice.

That having been said, what you really want is to keep a list of unique terms. You can do that this way:

my %term_hash = map { $_ => 1 } @TERMS; my @INDEX = keys %term_hash;

This differs from what you're doing mainly in that the @INDEX you get is not in any particular order.

See also How can I extract just the unique elements of an array?