develooper Front page | perl.perl5.porters | Postings from November 2011

Re: Explanation of "for" and "foreach" in perldoc

Thread Previous | Thread Next
From:
Eric Brine
Date:
November 29, 2011 00:48
Subject:
Re: Explanation of "for" and "foreach" in perldoc
Message ID:
CALJW-qG4b-X7=6p8MPBfouUg9PJFemZNG_E2Cev9UqSfYqcKCA@mail.gmail.com
On Tue, Nov 29, 2011 at 2:30 AM, Abigail <abigail@abigail.be> wrote:

> I use "for (my $i; $i < @array; $i ++)" and "foreach my $key (@array)",
> because when *reading it out loud*, it sounds better than the other
> way around, or when having a single name for it.
>

...and what about counting loops?

Why do people always leave out C<< for (EXPR..EXPR) >> when discussing
preferences for "for" vs "foreach"?


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About