This example will not catch errors with fork. You first need to test if the returned $pid is defined or not:
unless(defined(my $pid = fork)) { die "Could not fork: $!"; #fork failed } elsif($pid) { sleep 1; #parent kill 9, $pid; wait; } else { print "Yay!\n" while 1; #child }
In reply to (dkubb) Re: (3) Forking Issue
by dkubb
in thread Forking Issue
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |