"Use of uninitialized value in array element" occurs when you use undef as an array index:
my @array = (5, 10);
my $index = undef;
It would still output "5" (in addition to the warning), by interpreting undef as 0 - which may or may not be what you intended (hence the warning).
To get rid of the warning, make sure that any variable or expression that is used as an array index will never be undef. If the undef values occured by accident, fix the bug. If you're sure that undef values are no accident and that they should indeed be interpreted as 0, you can make that explicit for example using the // operator: