|Do you know where your variables are?|
Who's referencing my variables?by RutgerVos (Initiate)
|on Apr 01, 2014 at 09:51 UTC||Need Help??|
RutgerVos has asked for the
wisdom of the Perl Monks concerning the following question:
in a fairly large set of modules I am noticing some objects not getting cleaned up when they go out of scope: circular references. As these objects get passed around quite a lot it is hard to pin down where this is happening. What would be a way to find out who's referencing whom?
Thinking this through a little bit I imagine the way would be to traverse the symbol table(s) and look at package variables that might be referencing the objects. Can somebody give me a hint how I would probe 'my' variables that live inside packages? As far as I can tell, %Foo::Bar:: gives me subroutines and our variables but not 'my' variables. I'm sure there's a way around that ;-)