sub bar { state $foo; ... my $code = sub qux { state $foo; }; ... }