my $pid = fork(); if (not defined $pid) { print "resources not avilable.\n"; } elsif ($pid == 0) { while(1){ &receive; } } else { MainLoop; }