# look for @AoA row and col containing index # for first non-zero element in @A for my $index (0..$#A) { if ($A[$index]) { ROW: for my $row (0..$#AoA) { for my $col (0..$#{$AoA[$row]}) { if ($AoA[$row][$col] == $index) { print "$row $col\n"; last ROW; } } } last; } }
In reply to Re: Control loop 2D array
by ysth
in thread Control loop 2D array
by FFRANK
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |