in reply to Re: foreach count variable
in thread foreach count variable

yep. in perl6 this attribute would be nice.
there is even one more way to go:
foreach my $foo (@bar) count $c { print $c . "-> " . $foo; }
or maybe:
foreach my $foo (@bar) counting $c { print $c . "-> " . $foo; }