You should eliminate the warnings since they may indicate bugs in your code. I do not know which line is line # 32, but perhaps you could try to determine the cause of the warnings by printing the contents of your @loc and @arr2 arrays. Do they have as many elements as you think they have?