$socket = socketpair($child_fh, $parent_fh, .....); $child_fh -> autoflush(); $parent_fh -> autoflush(); $pid = fork(); ....