Hi all,

 I ran into the problem with forking and I am not able to figure out what
happens. Here is the code (let's call the program server):

$pid = open(HHH,"|- ");
if($pid){
 print HHH "something\n";
}else{
 exec "client"
}

Notice that I do not call close(HHH) because I want the parent just to
spawn the child, print something into it, and exit. And that is exactly
what happens. If I look at processes I see only client running, I can see
that client does get "something" from STDIN.
 Now the weird part: if I put in the beginning of the program "include
Mail::Mailer" (or some other modules) but never use it, the server never
exits (as if I put close(HHH) in there)!!! Even more, when I kill the
server by hand (except with kill -9), it kills the client as well, even
though I never setup setpgrp(0,0) in the server. 
 Same thing happens if I spawn (and kill) some Tk things before that peace
of code.
 Please explain to me what is happening, and how I can control these
things, if it is possible.


                                        Thank you in advance,


                                                        --Max


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to