in reply to Re: How foreach loops decide what to iterate through (push array inside foreach)
in thread How foreach loops decide what to iterate through
Now I am curious as to what perl is doing internally. Can any monks offer a deeper explanation?
I think it iterates over the array instead of putting it on the stack. You can circumvent the optimisation by changing for (@a) to for ((),@a).
|
|---|