in reply to Tracking Memory Leaks

Try running your script in the perl debugger. You can pretty-print all the variables in a package along with their values using the V and X commands if you want to know what variables you are currently using.

See the section on "Debugging Perl memory usage" in perlman:perldebug.