note
idsfa
<p>This skeleton has no error checking, but it does only spawn one child.</p>
<code>
my $kidpid;
while( ... loop condition ... )
{
.
.
.
if( ! $kidpid)
{
if(0 == ($kidpid=fork()))
{
# I'm the child
exec { ... }
die("How did I get here?");
}
}
# I'm the parent, keep doing stuff
.
.
.
# Before I loop, do a lame check to make sure kid
# is still running. Ought to use a Proc:: Module
$kidpid=0 if(! grep { m/^\s+$kidpid\s/ } `ps ax`);
}
</code>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-195379">
<hr/>
<I>The intelligent reader will judge for himself. Without examining the facts fully and fairly, there is no way of knowing whether vox populi is really vox dei, or merely vox asinorum. — Cyrus H. Gordon</I>
</div></div>
537620
537620