#!/usr/bin/env perl use XMLRPC::Transport::HTTP; use XML::Xerces; use XML::Xerces::DOMParse; use Carp; use Fcntl ":flock"; my $daemon = XMLRPC::Transport::HTTP::Daemon -> new (LocalPort => 8081, Reuse => 1) -> dispatch_to('Monster') ; print "Contact to XMLRPC server at ", $daemon->url, "\n"; $daemon->handle; sub go{ shift if UNIVERSAL::isa($_[0] => __PACKAGE__); my $CP = shift; $SIG{CHLD} = 'IGNORE'; ...various faffing about with $CP.... FORK: { $child = fork; if (defined $child) { if($child == 0){ my $exec = "/usr/local/bin/monster -i$id $filePath$file &"; qx/$exec/; } }elsif ($! == EAGAIN) { sleep 5; redo FORK; }else { die "Can't fork: $!\n"; } } return 0; }