It looks like you could use some practice with grep, map, and join, three essential tools for anyone working with arrays.
Here is a version of your script that does the same thing using these three functions alone. Note that the printing out of the data is slightly different as this version does not include a trailing : after the final row.
Outputsmy @arr=( [qw(a b c d)], [qw(e f g)], [qw(h i j)], [qw(e f g)], [qw(h i j)], [qw(e f g)], [qw(h i j)], [qw(a b c d)], [qw(a b c d)], ); print join(':', map {join '', @$_} @arr) . "\n"; my @arr1 = grep {! grep {/e/} @$_} @arr; print join(':', map {join '', @$_} @arr1) . "\n";
abcd:efg:hij:efg:hij:efg:hij:abcd:abcd abcd:hij:hij:hij:abcd:abcd
- Miller
In reply to Re: Remove "Row" from multidimensional array
by wind
in thread Remove "Row" from multidimensional array
by relientmark
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |