develooper Front page | perl.perl6.internals | Postings from November 2001

Re: Yet another switch/goto implementation

Thread Previous | Thread Next
From:
Sam Tregar
Date:
November 8, 2001 16:16
Subject:
Re: Yet another switch/goto implementation
Message ID:
Pine.LNX.4.33.0111081914240.30386-100000@localhost.localdomain
On Thu, 8 Nov 2001, Dan Sugalski wrote:

> Yes, it is a bug. There's an array in list context--it's supposed to be
> flattened before the foreach loop gets evaluated. (And if there are
> multiple arrays in the list it works as you'd expect)

Sorry, I quoted the wrong section.  It really isn't a bug - the next
paragraph in perlsyn explains:

       If any part of LIST is an array, "foreach" will get very
       confused if you add or remove elements within the loop
       body, for example with "splice".   So don't do that.

-sam



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