in reply to
Re: forking through a subroutine
in thread forking through a subroutine
I'm writing something similar as well at this moment which
might come in handy.
You can pass a reference to a sub and it's parameters to the
spawnChild sub, which will provide you with it's PID and
a filehandler to the child.
It's all still very basic and nothing fancy, that's because I'm
doing lots of learning and testing right now ... but it works ;-)
# Declaration of Subroutines
unless (defined $pid)
warn "Cannot fork: $!\n";
die "Could not fork\n" if $Cnt++ > 5;
} until defined $pid;