my @two_d = ( [qw( foo bar baz)], [qw( bar baz quux)], [qw( baz quux foo)] ); my @rows = grep { grep {/foo/} @$_ } @two_d;
You get a 2-d array containing only the rows matching 'foo'.
After Compline,
Zaxo
In reply to Re: using grep with two dimensional arrays
by Zaxo
in thread using grep with two dimensional arrays
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |