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

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

Thread Previous | Thread Next
From:
Christian Walde
Date:
November 29, 2011 00:53
Subject:
Re: Explanation of "for" and "foreach" in perldoc
Message ID:
op.v5o9mosyn4yvrm@digitizedsqueak
On Tue, 29 Nov 2011 09:47:55 +0100, Eric Brine <ikegami@adaelis.com> wrote:

> 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"?

Because .. does result into an array?

-- 
With regards,
Christian Walde

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