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).
In reply to Re^2: How foreach loops decide what to iterate through (push array inside foreach)
by ikegami
in thread How foreach loops decide what to iterate through
by lefthanded
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |