Sadly that's kind of a known problem with Perl. With my last project (a somewhat big Perl program) I learned never to store any object in a way that global destruction has to clean it up.
Search, Ask, Know
Comment on Re: Another good reason to "use strict"?