At 07:53 PM 11/7/2001 -0500, Ken Fox wrote:
>Dan Sugalski wrote:
> > No it isn't. It can get the integer length of the array and stuff it in a
> > register at the beginning of the loop, or do an integer compare when it
> > needs to, depending on the semantics of the loop.
>
>Wow. Did you just come up with a place in Perl where static
>behavior is guaranteed?
>
>   my @array = ( 1 );
>
>   foreach my $e (@array) {
>      push @array, $e + 1;
>   }
>
>No, I guess not. ;)

Gack. Looks like a mis-placed optimization in perl 5. The list of a foreach 
is *supposed* to flatten at loop start and be static. Apparently not. :)

Care to file the perl 5 bug report, or shall I?

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to