Subject: | Callbacks for GLOBAL_bless |
This is a wishlist item, but rather than a patch, I've sent you an
entire tarball (because I can never figure out the patch format someone
wants and I'm always getting it wrong).
Basically, when tracking down leaks, I often want to know when objects
are instantiated. So let's say I have File::Temp objects leaking and I
want to know every place they're getting instantiated. The attached
tarball lets you do this:
use Data::Dumper;
sub find_file_temp {
my ( $reference, $class ) = @_;
# the object is instantiated two levels up
my ( $package, $file, $line ) = caller(2);
warn Dumper({
package => $package,
file => $file,
line => $line,
class => $class,
ref => $reference,
}) if $class->isa('File::Temp');
}
use Devel::Leak::Object GLOBAL_bless => \&find_file_temp;
It comes complete with documentation, tests, updated MANIFEST and Change
log.
Cheers,
Ovid
Subject: | Devel-Leak-Object-0.93.tar.gz |
Message body not shown because it is not plain text.