in reply to Perl Timers and command-line processes
depending on your system, you can use Win32::Process and arbitrarily kill things after a given period of time. Whether or not this eats memory is up for debate.
If you're on the other type of system, some magic with ps should get you started.