in reply to Growing a Hash of Hashes via its reference

Maybe you need to localize $misfits in sub find_misfits?
my ($whole_world, $misfits) = @_;

It is difficult to say because the code you posted has syntax errors and is not a complete example that we can run. So, we can not duplicate your error.

The strictures will probably help you:

use warnings; use strict; use diagnostics;