To be really sure you are not leaking memory, check out Devel::Leak.
In reply to Re: memory leak by BioLion in thread memory leak by bob_dobalina