--initialization as you have it-- $cli1=$server->accept(); $cli1->recv($data,10,0); die 'Aycaramba!' if $data ne 'READY' ; $cli2=$server->accept(); $cli2->recv($data,10,0) die 'Aycaramba again, mon!' if $data ne 'READY'; #$maxgames is predefined (passed from the exec!) #$cli1score #$cli2score for(1..$maxgames) { $cli1->print('GO'); $cli2->print('GO'); #ready to rock 'n' roll! #just wait for the input from the first player $cli1->recv($cli1var,10,0); $cli2->recv($cli2var,10,0); #now play the game my %win=('Rock',1,'Paper',2,'Scissors',3); my $avar1,$avar2; #warning: very little error-handling, but do you need it? $avar1=$win{$cli1var}; $avar2=$win{$cli2var}; if($avar1==$avar2){} elsif($avar1-1 == $avar2){$cli1score++;} elsif($avar1==1 && $avar2==3){$cli1score++;} else{cli2score++;} } #end long game loop $cli1->print('STOP'); $cli2->print('STOP'); print "total scores: player 1: $cli1score, player 2: $cli2score, player user: EXTRA CREDIT POINTS!\nHave a nice day\n"; $cli1->close(); $cli2->close();