How do I grep values from an array of arrays? My attempt:
my $match =grep (/value/, @array);
if ( $match <= 0 ) { ... }
I am always getting zero as a output which is incorrect.
I am able to print $value after 2 for, loops so I think grep will only work when there is 1 loop.
for $value (array) {
for my $value1 (@$value)
{ print $value1 };
Thanks.
grepdoes not return a list in scalar context (e.g. when assigning its result to a scalar). It would crash the program if it tried.