I think he was just "stirring up" debate on the lack of "my" in the latter
example.  Ie, not declaring variables (and thus scope).  :)  I'm not going
to comment down that line, since that would trigger more of a holy war
than "clear code" did.  hehehe.

Along the lines of another post by PK, I like that everyone has expressed
their various opinions.  They're all wrong except mine, but that's okay...
they'll learn.  *grin*  I AM JOKING, of course!!  But seriously, I like
that, from what I can tell, the various opinions have been
voiced/discussed, and it doesn't seem to have turned into a "holy war" too
much.  :)

Cheers,
-Alex

On Mon, 15 Apr 2002 12:39:37 +1000, Ken Williams wrote:

> >>  Code B:
> >>       foreach (@array) { $_++ }
> >
> >
> > Do my vars suddenly spring into existence now?
> 
> Huh?  I'm not sure what you mean.  If you don't indicate an 
> iterator variable, $_ will be used, and its scope will be 
> localized to the execution block of the 'foreach' loop.
> 
> See the section on "Foreach Loops" in the 'perlsyn' man page for 
> the details.
> 
>   -Ken
> 


==================================================
  Email:  [EMAIL PROTECTED]
  Website:  http://www.beardeddragon.org/
==================================================


Reply via email to