tie @ary, "My::Class", "some", "el", "ems"; for (@ary) { some_code($_); }
What if the loop is left by last , next , redo , return or goto ?
Does the code hooked into the tied array really catch all edge cases sufficiently for your progress-bar?
Is there any ->DESTROY of the tied class being called?
NB: As already told, be aware about restrictions on Perl versions.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
In reply to Re: Getting for() to accept a tied array in one statement
by LanX
in thread Getting for() to accept a tied array in one statement
by perlancar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |