Tore Aursand <> wrote:
> On Thu, 30 Oct 2003 18:10:17 +0000, Jürgen Exner wrote:
> >>> I'm now trying
> >>> for (@entry)
>
> >> Use 'foreach';
> >> foreach ( @array )
>
> > What exactly would be the difference between 'for' and 'foreach'
> > (besides the additional 4 letters)?
>
> I would say readability,
Debatable, but yes.
> plus that it simply works better than writing
> 'for (my $i = 0..@array)'
No. The problem there is nothing to do with for/foreach. foreach can
in every single case be replaced with for.
Ben
--
Like all men in Babylon I have been a proconsul; like all, a slave ... During
one lunar year, I have been declared invisible; I shrieked and was not heard,
I stole my bread and was not decapitated.
~
~ Jorge Luis Borges, 'The Babylon Lottery'