hence you need to switch to while and add an iterator method ->each to your API °That would now be the ideal for me, but don't you need to instantiate the iterator before calling it? Like:while (my ($widget) = $api->each( $item->{sets}{widgets})) { ... }
I wonder if you can combine the intializer with the iterator in a single call and have it rebless itself on the first call. Algorithm::Combinatorics does something similar.my $iter = $api->each( $item->{sets}{widgets} ); while (my ($widget) = $iter->()) { ... }
In reply to Re^6: Using lazy list with a for loop
by Anonymous Monk
in thread Using lazy list with a for loop
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |