instead of using signals or wait & co to check when children exit, you can create the child processes as open(my $child, '|-') and use the $child file handler inside a select() driven event loop to detect when the child exits and handle any other blocking operation at the same time.