in reply to Why Doesn't each() DWIM?
why doesn't each automatically reset after loops are exited?
How does it know when you've exited a loop?
That's not a flippant question. Consider more complicated control flows. For example, with an iterator interface that abstracts away the hash to where you can't reset it, how is perl to tell when you want to reset the hash iterator?
I suspect that there's no meaningful algorithm to figure this out in a language that allows you to define your own flow of control.
|
|---|