# Record fd3 for later use open($orig_fd{3},">&=",3); for $id (1..10) { open($child{$id,3},">",$tmpfile{$i}); # make $child{$id,3} file descriptor 3 for me and all future children connect_filedescriptor(3,$child{$id,3}); # start the child open3(...) } sub reaper { # When a child dies seek $child{$id,3},0,0; # Print the captured fd3 to the parent's original fd3 print $orig_fd{3} <$child{$id,3}>; close $child{$id,3}; }