in reply to "Use of uninitialized value in pattern match (m//)" warning, doing a grep on 2D array

That means that $_->[0] is undefined, which means the first value of one of the array references in @matrix is undefined.

You can work around the warning by checking if $_->[0] is defined or not. But since you don't seem to be expecting it to be undefined, there might be a bug somewhere and that would just mask the bug.

Possible problem: You might have autovivified an element of @matrix by accessing it when you shouldn't have.

  • Comment on Re: "Use of uninitialized value in pattern match (m//)" warning, doing a grep on 2D array
  • Select or Download Code