more useful options | |
PerlMonks |
Re: What does Test::LeakTrace do?by choroba (Cardinal) |
on Jan 20, 2018 at 22:49 UTC ( [id://1207600]=note: print w/replies, xml ) | Need Help?? |
You can get more information with the -verbose option:
And it shows:
So, the leaked scalar contains the required file name. Why is that? Let's read the documentation: These SVs include global variables and internal caches. For example, if you call a method in a tracing block, perl might prepare a cache for the method. Thus, to trace true leaks, no_leaks_ok() and leaks_cmp_ok() executes a block more than once. And indeed, running no_leaks_ok shows:
So, it's probably some kind of a global variable. And indeed, compare the output with the one from
It shows the same scalar. So, it's just the entry in the %INC hash that prevents Perl from including the file once more if you require it again.
In Section
Seekers of Perl Wisdom
|
|