The following both provides the index and makes $ele an alias to the array element as if you had done for my $ele (@array):
for my $idx (0..$#array) { for my $ele ($array[$idx]) { ... } }
In reply to Re: array looping with foreach
by ikegami
in thread array looping with foreach
by bst_perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |