<?xml version="1.0" encoding="windows-1252"?>
<node id="834057" title="Re^2: a sub within a sub -- revisiting" created="2010-04-11 02:21:02" updated="2010-04-11 02:21:02">
<type id="11">
note</type>
<author id="381608">
ikegami</author>
<data>
<field name="doctext">
&lt;p&gt;Note that the above leaks if the anon sub accesses &lt;c&gt;$bar&lt;/c&gt;. That would be the case if the anon sub is recursive, for example. I find the following simpler, and it doesn't leak.

&lt;c&gt;
sub foo {
   ...

   local *bar = sub {
      ...
   };

   bar(...);
}
&lt;/c&gt;
</field>
<field name="root_node">
833941</field>
<field name="parent_node">
833943</field>
</data>
</node>
