http://www.perlmonks.org?node_id=1056916


in reply to Missing reference and memory leak

This looks suspicious:

        delete $machines{+shift};

Do you mean $self instead of +shift? That may not solve the original problem, but it might help you debug further.