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

Your idea is fine, but the execution could be better.. :) There's no need for scalar nor printf there.
for (my $count = 0; $count < @bar; $count++) { print "$count -> $bar[$count]\n"; }
But then, I'd still prefer the for(0 .. $#bar) form proposed further down the thread.

Makeshifts last the longest.