I think your issue is that the open of ssh on the local end is also a fork. I'm guessing that maybe close isn't waiting for the child to finish when using open2 the way it does for open. perlipc says open does but doesn't mention this regarding open2. I would wait for the ssh processes to finish before calling $pm->finish. See the waitpid function as well as perlipc.