FORK: { if ($pid == fork){ #deal with the parent process #pid of child is stored in $pid }elsif (defined $pid){ #handling child process #parent pid is available via the getppid function }elsif ($! =~/No more processes/){ # EAGAIN, this error we should be able to fix sleep 5; redo FORK; } else { #this should'nt happen at all die "cannot execute fork: $!\n"; }