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


in reply to hash elements are lost during reaping

What am I doing wrong here?

You're assuming its the same hash , print out the reference and you'll see that its different,  warn \%TrappedPIDs;

But I'm guessing as you don't show the forking part

:)Mr. Peabody Explains fork()