sub closure { my $s; return sub { $s=5; my $i; } } my $f = closure(); while (1) { $f->(); }