That's not desirable and the reason why I was speculating about "localizing" the iterator, i.e. saving the state and restoring it after leaving the loop.
This would allow to nest two for loops over the same hash. That's not possible while using each and this "global" effect is constantly using headaches when passing around hashes.
But ... I can't even tell if such a localization can be implemented in a reasonable way.
Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery
In reply to Re^10: Why does each() always re-evaluate its argument? ("for_list" )
by LanX
in thread Why does each() always re-evaluate its argument?
by Darkwing
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |