in reply to Clearing memory

Its probably a bug in Net::DNS::ZoneFile, but it could be that you're somehow leaking filehandles, so it can't hurt to close $zone when you're done with it.