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
In reply to Re^2: Style and Preference on Loops
by GrandFather
in thread Style and Preference on Loops
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |