Now, since the child processes fork(), I still have to keep them in a loop to watch what they spit out, right? ...thing is is that I would then have two different loops of which neither are really related to each other so I don't want to nest the loops that they are in. Am I correct?
eg.
main: fork(child1); fork(child2); # endless loop until signal caught from # shell (child1): loop(read from child1) { react } # endless loop until signal caught from # shell (child2): loop(read from child2) { react } main END:
main: fork(child1); fork(child2); # endless loop until signal caught from # shell (child1): loop(read from child1) { react # endless loop until signal caught from # shell (child2): loop(read from child2) { react } } main END:
How would this be done? I have read through the Perl cookbook on IPC and I can't seem to pick up how I would do something like this using the information provided in their examples and documentation. I have read perldoc perlipc but I admit that I am so new to this stuff that a lot of it is jargon that is over my head.main: fork(child1); fork(child2); # endless loop until signal caught from # shell (child1): loop(true) { check child1 # call sub reacting from input; check child2 # call sub reacting from input; } # loop until a signal is caught. END main:
I have already written the meat of the three modules. This is the biggest part that stumps me.
I think what I really need is some documentation that doesn't talk above my head :( One of these days I will understand the high-talk but I have the terrible problem where I can get lost in the words very quickly. If anyone has a site or something out there that is easily read I would love that. I also learn quite quickly from source code. If there is some code out there that would give me an idea of how to do what I am trying to do that would be very helpful as well.
Thanks guys.
----------
- Jim
In reply to A challenge...at least for me. by snafu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |