note
ikegami
<blockquote><p><i> there is at least one scope that never releases its memory.</i></blockquote>
<p>In your original program, yes. It never releases memory, but that memory is still needed. That doesn't meet the definition of a leak.
<p>Keep in mind that the run-time effect of
<c>
my $i;
</c>
is similar to
<c>
Hook::Scope::POST(sub { $i = undef });
</c>
<p>It pushes an instruction on the stack to clear the scope on exit (which could happen, say, if an exception occurs).
1159029
1159109