On Mon, Apr 28, 2008 at 07:53:07PM +0000, Matt Sergeant wrote: > Oh interesting. So it's specific to if() blocks. That's a huge relief and I > consider it way less of a showstopper - I thought the file was remaining > open until END{}. More precisely, the bug is a mismatch between compile-time and run-time scopes. In the following: { if (my $x = ...) { .. } else { ... } X } Y At point X, at compile time, $x is no longer in scope; any mention of $x refers to an outer $x (or $::x). At run time, $x has not been freed yet, and wont be until the next scope is exited (ie just before Y) Adding the extra scope exit op could be done only when the if includes a my, avoiding the slowdown on the general case. -- You never really learn to swear until you learn to drive.Thread Previous | Thread Next