28. 4) Devel::Leak::Object
use Devel::Leak::Object qw{GLOBAL_bless};
$Devel::Leak::Object::TRACKSOURCELINES = 1;
my $ref; $ref = bless $ref => "XXX";
Tracked objects by class:
XXX 1
Sources of leaks:
XXX
1 from - line: 3
29. 5) DESTROY
sub Ref1::DESTROY { warn "destroyed REF1" }
sub Ref2::DESTROY { warn "destroyed REF2" }
my $x;
my $f = bless sub {
$x;
bless sub { $x } => "Ref2";
} => "Ref1";
$f->();
destroyed REF2 at - line 2.
destroyed REF1 at - line 1.