That has all the problems of the each builtin.
Better to have a generator creator and user.
my $iter = $api->get_widgets_iter(); while ( my ( $widget ) = $iter->() ) { ... }
In reply to Re^6: Using lazy list with a for loop
by ikegami
in thread Using lazy list with a for loop
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |