The stupid question is the question not asked | |
PerlMonks |
Re: Re: Re: sub and anonymous subby Courage (Parson) |
on Jun 21, 2002 at 06:12 UTC ( [id://176234]=note: print w/replies, xml ) | Need Help?? |
I'll answer only to 1st item, because I see 2nd already resolved. As best of my understanding, yes, ref count for $depth is increased when "sub recurse" is compiled. And if, say, we compiled anonymous sub as my $r=sub{$depth} and then $r goes away due to refcounting, I see that ref count for $depth will be decreased once (even if $depth was used several times inside that sub). Let me note that I just checked "perlsub" and see exactly your question explained at the section "Persistent Private Variables" Best wishes,
In Section
Seekers of Perl Wisdom
|
|