1 sub AddToUserArray { 2 my $UserID=$_[0]; 3 my $i=0; 4 my $Pexists=0; 5 my $Size; 6 7 if($UserID eq "") { # incase a bad UserID was recived. if Pexists=1 it will skip &addtouserlog 8 $Pexists=1; 9 return $Pexists; 10 } 11 12 $Size=scalar(@Participants); 13 for($i;$i<$Size;$i++) { 14 if ($Participants[$i] eq $UserID) { 15 $Pexists=1; 16 last; 17 } 18 } 19 if ($Pexists==0) { 20 $Participants[$i]=$UserID; 21 } 22 return $Pexists; 23 }