By the way, that code has a memory leak (cyclic reference ($fetch contains a reference to a closure which captures $fetch)).
Replace
my $fetch; $fetch = sub { ... $fetch->(); ... }; ... $fetch->(); ...
with
use feature qw( current_sub ); my $fetch = sub { ... __SUB__->(); ... }; ... $fetch->(); ...
In reply to Re^3: coderef for 1 .. 2?
by ikegami
in thread coderef for 1 .. 2?
by ronstudio
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |