You only want to use delete on an array in
special circumstances. What you want is splice.
my @array = ("index0","index1","index2","index3","index4");
splice @array => 2, 1; # Replace a 1 element subarray starting
# at index 2 with an empty list.
# Array is now ("index0", "index1","index3","index4");