http://qs1969.pair.com?node_id=615398


in reply to Re^5: private recursive subroutines
in thread private recursive subroutines

I started to look into doing this (adding the special case if refcnt is 2 and the sv is an rv to a cv that closes over the sv to the "/* Can clear pad variable in place? */" code in scope.c), but something seems awry with the refcnt:
perl -wle'use Devel::Peek; { my $f; $f = sub { my $c = shift; print $c +; $f->($c-1) if $c }; Dump $f; $f->(3); Dump $f }'
The refcnt is 2 in the first dump and 5 in the second. Why?