Essentially what you are doing is something like this:
my @a = (1); for ( my $i = 0 ; $i <= $#a ; $i++ ) { push( @a, 1 ); }
So the loop isn't being restarted or re-evaluated, but because you are extending the thing it's iterating over, it never gets to the end.
In reply to Re^3: How foreach loops decide what to iterate through
by jasonk
in thread How foreach loops decide what to iterate through
by lefthanded
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |