I don't know, but my guess is that perl simply keeps a pointer to the array-element it is at in the loop. I did a few tests with splice and perl did exactly what I expected from it. It looped over the array positions (!! not the array values) until it was outside the array length (because of looping or a shrinking of the array).
Would be nice if someone could show me a case where perl gets confused. I could not create one
In reply to Re^2: How foreach loops decide what to iterate through (push array inside foreach)
by jethro
in thread How foreach loops decide what to iterate through
by lefthanded
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |