in reply to Re: Multithreading
in thread Multithreading
Another option, is to have the children write back to the parent.
Note, I'm on a windows box so I wasn't able to test the above code, but it should be close. Now for mulitple children you'll need to use IO::Select.my $pid = open ($handle, "-|"); if ($pid){ my $return = <$handle>; close $handle; # Do something with the return value } else { # Do something interesting print $handle "Something interesting"; close $handle; exit; }
|
|---|