in reply to Re^2: Automatic Loop Counter not in perl
in thread Automatic Loop Counter not in perl

I'd do it like this
my @array = qw{zero one two}; for my $i (0..$#array){ print qq{$i\t$array[$i]\n}; }

Replies are listed 'Best First'.
Re^4: Automatic Loop Counter not in perl
by ikegami (Patriarch) on Aug 21, 2007 at 14:44 UTC
    And if you really wanted $_:
    my @array = qw{zero one two}; for my $i (0..$#array){ for ($array[$i]) { print qq{$i\t$_\n}; } }