in reply to Re: Keeping a Count in foreach
in thread Keeping a Count in foreach

Yes, but the first two are completely different from the last two. We have to call these control structures *something*. When talking about them, we call the first two "foreach loops", and the last two "for loops", regardless of which keyword is used. perlsyn follows this convention in its =head2 headers, and arunhorne is using it in his question.
$ perl -MO=Deparse,p -e 'for(@z){print}' foreach $_ (@z) { print $_; } -e syntax OK

Replies are listed 'Best First'.
•Re: for != foreach
by merlyn (Sage) on Jun 18, 2002 at 03:21 UTC