in reply to How do I completely remove an element from an array?

splice was designed to handle this.
splice @array, $indextoremove, 1;

splice can be called in any of the following forms:

splice ARRAY, OFFSET, LENGTH #removes anything from the OFFSET index through the index OFFSET+LENGT +H-1 splice ARRAY, OFFSET, LENGTH, LIST #same as the previous but replaces elements removed with those in LIST splice ARRAY, OFFSET #removes anything from the OFFSET index on

In any of these cases, splice returns the elements it removed.