Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
If I have an array @x, that I have, say, initialized up to $x[5][11], is there some way of looping over the rows (and then the columns within each row) without setting up the classic for loops with counters such as $i and $j? I read somewhere that if you are using counters in perl, you are not doing it right, so I am wondering about other syntax (foreach?) that might do that.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: looping over multidimensional arrays
by LanX (Saint) on Sep 20, 2018 at 14:35 UTC | |
|
Re: looping over multidimensional arrays
by Marshall (Canon) on Sep 20, 2018 at 15:42 UTC | |
|
Re: looping over multidimensional arrays
by AnomalousMonk (Archbishop) on Sep 20, 2018 at 16:57 UTC | |
|
Re: looping over multidimensional arrays
by BillKSmith (Monsignor) on Sep 20, 2018 at 20:12 UTC | |
|
Re: looping over multidimensional arrays
by haukex (Archbishop) on Sep 23, 2018 at 08:02 UTC | |
|
Re: looping over multidimensional arrays
by Laurent_R (Canon) on Sep 20, 2018 at 21:24 UTC |