http://www.perlmonks.org?node_id=991213


in reply to Re^6: filtering an array
in thread filtering an array

One or more of the elements of the array @positions is undefined. The easiest way to check this is like this:

use Data::Dump qw(pp); pp([@positions]);

This will give you a printout of the value of each element in array @positions. I expect we will see that some are "undef" meaning undefined. It will be these elements that are causing the problem.