in reply to Ignorance Isnt Always Bliss

This snippet shows what is causing your error

my @a = (); $a[-1] = 1;
you are assigning to an array using a negative index that is larger than the size of the array.