Subject: | suggest option recording where a thing was located |
Date: | Sun, 14 Jun 2009 08:37:54 +1000 |
To: | bug-Test-Weaken [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
While going 12 rounds with the unfilled array problem of my other
ticket, I would have quite liked to know where it was that the
unfreed_proberef had come from.
As an option maybe the follow() code could record a location as a
string. If the top return was
[ {foo=>{}} ]
and the inner hash there leaked then it could be recorded/reported as
"top array[0] -> hash{'foo'} -> hash"
possibly working in any blessing as a clue to what class is offending.
An actual perl expression might work too,
"%{$top->[0]->{'foo'}}"
but if there's scalar references it might bounce confusingly between
pre-fix and post-fix form, if you know what I mean.
Either way it'd be recorded before destruction, since after that of
course the various higher containers are gone. Building strings could
be a bit slow on a very big structure, but if it was only an option you
could turn it on when trouble arises or when you're getting desperate!