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
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How foreach loops decide what to iterate through (push array inside foreach)
by ikegami (Patriarch) on Feb 14, 2009 at 03:51 UTC | |
by jethro (Monsignor) on Feb 14, 2009 at 05:25 UTC | |
by ikegami (Patriarch) on Feb 14, 2009 at 05:37 UTC |