You can get more information with the -verbose option:
leaktrace{ require './AlmostEmpty.pm'; } -verbose;

And it shows:

leaked SCALAR(0xa6a8a0) from ./3.pl line 7. 6:leaktrace { 7: require './AlmostEmpty.pm' 8:} -verbose; SV = PV(0xa4ac20) at 0xa6a8a0 REFCNT = 1 FLAGS = (POK,pPOK) PV = 0xebe6e0 "./AlmostEmpty.pm"\0 CUR = 16 LEN = 24

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:

ok 1 - leaks 0 <= 0

So, it's probably some kind of a global variable. And indeed, compare the output with the one from

use Devel::Peek; Dump $INC{'./AlmostEmpty.pm'};

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.

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

In reply to Re: What does Test::LeakTrace do? by choroba
in thread What does Test::LeakTrace do? by TerryBerry

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.