On Jun 29, Bob Mangold said:
>Is there a perl variable that automatically counts loop iterations. Such that I
>don't have to use '$count':
No there is not. Either do:
my $i = 0;
for (@foo) {
# ...
}
continue { $i++ }
or do:
for my $i (0 .. $#foo) {
my $element = $foo[$i];
# ...
}
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
I am Marillion, the wielder of Ringril, known as Hesinaur, the Winter-Sun.
Are you a Monk? http://www.perlmonks.com/ http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc. http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter. Brother #734
** Manning Publications, Co, is publishing my Perl Regex book **