Chris Stinemetz wrote:
Hello List,
Hello,
I'm trying to grep an array of arrays, but I am getting the following error: Can't use string ("1") as an ARRAY ref while "strict refs" in use at form.pl line 121,<$COORDS> line 1281. Press any key to continue . . . Below is the grep statement: print grep { $_->[0][0]>= 0 } @coords; Any idea what I am doing wrong?
If @coords is just an Array of Arrays then that should be: print grep { $_->[0] >= 0 } @coords; Your example thinks @coords is an Array of Arrays of Arrays. John -- Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction. -- Albert Einstein -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/