Yes, the goal is not finding out the best way to do a progress-bar API (I think doing the Progress::Any-style progress bar is still okay), but how to emulate the style of a Python library.
As a bonus, one doesn't need to know the length of the list in advance with an iterator!
With for(@tied_array) we also doesn't need to calculate the length of the list in advance. We can just retrieve an item one by one, and for() will still invoke FETCHSIZE on each iteration. Which incurs an extra cost, admittedly.
In reply to Re^8: Getting for() to accept a tied array in one statement
by perlancar
in thread Getting for() to accept a tied array in one statement
by perlancar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |