in reply to Re^2: looping in 2d array
in thread looping in 2d array
This is true. And beside the point :-)
My point was to let Perl worry about the incrementing and bounds checking, eliminating many common problems such as accidently using the wrong counter or off-by-one errors. Personally, I find the keyword foreach coupled with a clear, recognizable variable name to be more readable than the for keyword which I'm familiar with from several inferior languages. Although I know perfectly well that Perl will do what I mean either way, I keep a clear distinction between the two to avoid confusion.
Time flies when you don't know what you're doing
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: looping in 2d array
by ww (Archbishop) on Nov 02, 2014 at 15:33 UTC | |
|
Re^4: looping in 2d array
by AnomalousMonk (Archbishop) on Nov 02, 2014 at 21:51 UTC |