in reply to Re^2: Style and Preference on Loops
in thread Style and Preference on Loops

No, it should read:

for my $idx ( 0..$#$mysql ) {

Replies are listed 'Best First'.
Re^4: Style and Preference on Loops
by eyepopslikeamosquito (Archbishop) on Aug 13, 2011 at 00:43 UTC

    Though my version was not incorrect, I agree this is probably a better alternative here.

    Generally, I dislike the ungainly $#some_array syntax and it's rarely needed. For example:

    $some_array[$#some_array]
    is better written as:
    $some_array[-1]
    because, apart from the unpleasant-to-read $#some_array, the second form avoids the duplication of some_array.