in reply to Perl and memory usage. Can it be released?

Does it have to be the same process? You could replace
do_work($qfn)
with something like
if (my $pid = fork()) { waitpid($pid, 0); } else { do_work($qfn); }