dragonchild has it though you'll have to ignore the confusing way he said it. You don't need a global, just a variable that is accessible. my()'d variables are perfectly acceptable here.
my $counter = 0; ... map { ++$counter; ... } ...
In reply to Re: Running count in map
by diotalevi
in thread Running count in map
by Solo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |