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

perl still has a problem with this:

@positions = grep $_->[1] =~ /ac/i, @positions;

with the same error Use of uninitialized value in pattern match (m//)

Replies are listed 'Best First'.
Re^7: filtering an array
by philiprbrenan (Monk) on Sep 01, 2012 at 23:19 UTC

    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.

      i don't see any that are "undef. that's a little strange. the data dumper output prints:

      9031,

      "A"

      etc. etc. this is a little strange...