use Devel::Leak; ... setup code my $handle; my $count = Devel::Leak::NoteSV($handle); ... code that may leak Devel::Leak::CheckSV($handle);