in reply to how to delete without resulting in undef

You probably want to use splice which removes elements entirely from the array, rather than delete which only deletes their values:

perl> @a = (1 .. 10);; perl> delete $a[ 3 ];; perl> print "@a";; Use of uninitialized value in join or string at 1 2 3 5 6 7 8 9 10 perl> @a = (1 .. 10);; perl> splice @a, 3, 1;; perl> print "@a";; 1 2 3 5 6 7 8 9 10

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.