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
In reply to Re: how to delete without resulting in undef
by BrowserUk
in thread how to delete without resulting in undef
by jithoosin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |