From: Kevin G. <ke...@go...> - 2004-05-28 15:33:25
|
Mike Schilli wrote: > Hi all, > > while investigating the circular reference problem, What is the circular reference problem? I don't remember hearing we had one? > Does anybody know why this snippet results in action items for > global destruction: > > package Log::Log4perl::Logger; > sub DESTROY { > warn "Destroying $_[0]"; > } that part defines a DESTROY method in that package > use Log::Log4perl::Logger; and that part runs the code in Logger.pm, which includes __PACKAGE__->reset(); which includes $ROOT_LOGGER = __PACKAGE__->_new("", $DEBUG); and that $ROOT_LOGGER object is what then gets DESTROY'd. That was too easy. Is this a trick question? -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |