in reply to scope and undef

Existance of a circular reference can cause this problem. i.e. even if you undef $self->{dbo}, there exist some reference to same object. So its not removed from memory.

Here is a very simple problematic case for circular reference.

foreach (1..5) { my $a; my $b; $a->{b} = $b; $b->{a} = $a; } # since both are pointing to each other they will never get coll +ected.
Please check your code for any circular reference.

you may try disconnecting the database handle just before you undef the $self->{dbo} as an immediate fix.

Cheers !

--VC



There are three sides to any argument.....
your side, my side and the right side.

Replies are listed 'Best First'.
Re^2: scope and undef (Devel::Cycle)
by lodin (Hermit) on Aug 28, 2007 at 11:13 UTC

    An aid in finding any circular references could be Devel::Cycle.

    lodin