note
Corion
<p>To me, this behaviour makes sense because <c>my $foo</c> gets reclaimed as soon as the current scope is left (<c>main::</c>). After the main program has ended, the <c>END</c> blocks fire, and after that, all global variables get cleaned up.</p>
<p>Except (as I just realize) that <c>our</c> is not supposed to be a global(ly visible) variable and hence should be reclaimed at the same time as <c>my $foo</c>, that is, in my opinion <i>before</i> the END blocks are run. </p>
<p>One more reason to avoid <c>our</c> IMO.</p>
<p><b>Update:</b> My opinion on the order of things is wrong - the order of execution/destruction of objects is exactly as it has to be because the <c>our</c> variable is a global variable except that the name is not visible outside the file.</p>
678159
678159