in reply to Is there a Perl variable to count iterations in a loop?
The default iterator variable in a foreach loop if no other variable is supplied.
use strict; use warnings; for (1..5) { print 2 * $_, " "; } print "\n"; __END__ 2 4 6 8 10 [download]