use Devel::Leak; foreach (1..100) { my $handle; my $count = Devel::Leak::NoteSV($handle); &pdfapi2(); my $count2 = Devel::Leak::CheckSV($handle); warn $count2-$count; }