in reply to Re^4: Using lazy list with a for loop
in thread Using lazy list with a for loop
hence you need to switch to while and add an iterator method ->each to your API °
while ( my ($widget) = $api->each( $item->{sets}{widgets} ) ) { . +.. }
the iterator will be exhausted as soon as ->each returns an empty list.
Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery
°) like others already suggested
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Using lazy list with a for loop
by ikegami (Patriarch) on Jan 03, 2023 at 04:18 UTC | |
by LanX (Saint) on Jan 03, 2023 at 15:24 UTC | |
by ikegami (Patriarch) on Jan 03, 2023 at 16:26 UTC | |
|
Re^6: Using lazy list with a for loop
by Anonymous Monk on Jan 03, 2023 at 04:16 UTC | |
by LanX (Saint) on Jan 03, 2023 at 15:32 UTC |