http://www.perlmonks.org?node_id=104857


in reply to Tracking Memory Leaks

Data::Dumper is a good tool to help track down circular references. If you see something like:

$VAR1 = \$VAR1; or $VAR1 = [ $VAR1 ]; or $VAR1 = { key => $VAR1 };

Then you know you have something to fix.

Also, I've experienced a few problems w/ memory leaks in perl 5.6.0 and linux. e.g.:

eval "use Any::Module";

Leaks memory for me, and doesn't appear to with 5.6.1. But I haven't done enough testing to be definitive about that. Someone else might be able to tell you more about this.