From: Kevin G. <ke...@go...> - 2003-06-03 16:12:35
|
Gordon Marler wrote: > I see what you're getting at - unfortunately, the change to using: > > my ($logger) = $self->{_logger}; > > still fails, as $self->{_logger} is "undef"! As the Data::Dumper output > I included indicates, the Log4perl reference in $self->{_logger} has > been garbage collected by Perl before my object's DESTROY method ever > gets called. Doh! You're right, sorry. I tried reconstructing your situation from the subsequent code samples you sent and it seems to go ok: use BE; $be = new BE; undef $be; #logs message from DESTROY just fine print "\nfinished\n"; So there must be something else going on. Nothing immediately occurs to me that might cause the behavior you're seeing, but if I think of something I'll let you know. -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |