XP is just a number | |
PerlMonks |
Re: spawning multiple child processesby pjf (Curate) |
on Jun 21, 2002 at 05:05 UTC ( [id://176225]=note: print w/replies, xml ) | Need Help?? |
Sounds like a job for the Perl cook-book to me. Section 17.11 (Forking Servers) has an example of a server that forks off a new process for each connection it receives. This is similar to what you're doing, except I presume you wish to fork off a new process for each server in your list.
The fork call creates a duplicate of a process, called a child. This child can do whatever it likes, independantly to the parent (including using exec to replace itself with another program). A very basic framework for what you're after might look like this (adapted from the code mentioned above in the Perl Cookbook):
That should hopefully give you a good start on solving your problem. Don't hestiate to ask questions if anything doesn't make sense. All the best,
Paul Fenwick
In Section
Seekers of Perl Wisdom
|
|