Perl Monk, Perl Meditation | |
PerlMonks |
Win32 fork() "problem"by maa (Pilgrim) |
on Mar 26, 2004 at 11:03 UTC ( [id://339977]=perlquestion: print w/replies, xml ) | Need Help?? |
maa has asked for the wisdom of the Perl Monks concerning the following question: Hi, I'm clearly doing something stupid but I can't see what it is. I've broken the test code down to a small case that exhibits the odd behaviour. Can anyone see/explain what I'm doing wrong here? (Apart from using fork() on winnt at all, that is.)
The file "fork2.ini" contains the asme as the __DATA__ part... another weirdness is that if I don't use <IN> and use <DATA> instead it prints out the source code! The output I get from running this is: C:\logchecks>fork3 Parent 433 got PID -605 from fork(433 test1) -605 test1 Parent 433 got PID -461 from fork(433 test2) -461 test2 Parent 433 got PID -533 from fork(433 test3) -533 test3 Parent 433 got PID -105 from fork(433 test2) -105 test2 Parent 433 got PID -521 from fork(433 test3) -521 test3 Parent 433 got PID -670 from fork(433 test3) -670 test3 wait() ed until -1 was returned. Done As you can see, it's printing values from the files out more than once. (Which I don't think it should.) Seeking enlightenment... Mark. UPDATE: if I change a couple of things it works...
I still don't understand what was going wrong in the original, however.
Back to
Seekers of Perl Wisdom
|
|