in reply to Re: Style and Preference on Loops
in thread Style and Preference on Loops
If you need to know the index and are using an increment of 1 then:
for my $index (0 .. $#$mysql) {
is much better than the C for loop variant. About the only time a C loop is likely to be used in Perl is when the "increment" is not 1 or the termination condition is not simply reaching an end point, although there are often better ways of achieving both objectives than using a C for loop.
Update: $#$mysql per eyepopslikeamosquito's catch
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Style and Preference on Loops
by eyepopslikeamosquito (Archbishop) on Aug 12, 2011 at 23:53 UTC |