Bob Showalter wrote:
>
> Jeff Westman wrote:
> > Eric Walker <[EMAIL PROTECTED]> wrote:
> >
> > > I got it so I need a counter which sends me to a for loop instead
> > > of a foreach.  Thanks..
> > >
> > > perlknucklehead
> >
> > I believe that 'for' and 'foreach' are completely
> > interchangable. I remember
> > reading somewhere that one was a synonym for the other.
>
> Yes, it's documented in perldoc perlsyn. I never write it as "foreach". But
> I never use csh either.

Hi Bob.

That's fair enough, as long as you have a consistent convention. I
use

  for (EXPRESSION; EXPRESSION; EXPRESSION)

and

  foreach (LIST)

unless the list has only one element, when I use

  for (EXPRESSION)

to alias $_ with the expression for the extent of the block.

Cheers,

Rob



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to