in reply to Memory Management in Perl

If you want to fix this without spending a lot of time on it, the simplest thing is probably to perform your tests from a child process.

Every time your script starts another series of tests, instead of just diving in to them, start by calling fork(). The child process should perform the tests and exit; the parent process should just call wait() to collect the child process. If the testing process leaks memory, file handles, etc. then they'll be cleaned up when the child process exits.

This isn't the elegant, professional solution, but it will solve the problem without requiring a major rewrite of the script.