Let's say I have the following:
my @array = ("index0","index1","index2","index3","index4");
delete $array[2];
# @array is now ("index0","index1",undef,"index3","index4")
# but what I wanted was:
# @array = ("index0","index1","index3","index4");
I know I could create a subroutine that sorted the array and then shifted the undefs off, but I need to be able to do this without altering the order of the array(besides eliminating undefs and collapsing the array to fill in the empty space). Any help would be appreciated, thanks.