in reply to Re^9: Why does each() always re-evaluate its argument? ("for_list" )
in thread Why does each() always re-evaluate its argument?
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^11: Why does each() always re-evaluate its argument? ("for_list" )
by NERDVANA (Priest) on Dec 08, 2023 at 05:41 UTC | |
by ikegami (Patriarch) on Dec 08, 2023 at 17:21 UTC | |
by NERDVANA (Priest) on Dec 09, 2023 at 21:21 UTC | |
by LanX (Saint) on Dec 08, 2023 at 17:13 UTC |