sub fibonacci { my ($visitor) = @_; my ($i, $j) = (0, 1); $visitor->() for $i; for (;;) { $visitor->() for $j; ($i, $j) = ($j, $i+$j); } }