From: Chris W. <ch...@cw...> - 2004-04-30 13:33:39
|
On Apr 30, 2004, at 9:20 AM, Ray Zimmerman wrote: > I temporarily modified SPOPS::DESTROY and added a DESTROY method to > Log::Log4perl::Logger to see when the $log was getting destroyed. I > verified that the SPOPS objects which were defined either as lexicals > or package variables in the "main" namespace of my script were getting > destroyed after $log UNLESS I specifically undef them before the > script terminates. Other SPOPS objects used in subroutines were > destroyed beforehand as expected. BTW, there are a bunch of > Log::Log4perl::Logger objects, I assume one for each package that > calls get_logger(). Correct, although it's more correct to say that each category gets a logger object. Generally 'category' and 'package' are interchangeable, but you can also create custom categories as we've done in OI2, skipping the use of packages entirely. > I would have thought that a lexical in a class would not be destroyed > until after all objects of that class were destroyed. Not knowing how > it works, maybe this isn't even possible. I don't suppose this is a > bug in perl? That's what I thought too. > I wonder what happens if you make $log a package variable? Good question! More investigation is clearly needed. Chris -- Chris Winters Creating enterprise-capable snack systems since 1988 |