in reply to which loop is better
The latter offers more control, but isn't necessary for most looping purposes.foreach (@arr[0..2]) { $_++; } for (my $i = 0; $i <= 2; $i++) { @arr[$i]++; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: which loop is better
by Joost (Canon) on Oct 04, 2004 at 10:54 UTC | |
by dave_the_m (Monsignor) on Oct 04, 2004 at 11:09 UTC | |
by Joost (Canon) on Oct 04, 2004 at 11:15 UTC |