$firstrandom = $list1[rand @list1]; push @list2, $random; $count = $#list1 while ($count != 0){ ###create list2 $random = $list1[rand @list1]; $ispresent = 'false'; for $I (0..$#list2){##check to see if team is already in list2 if ($random == $list2[$I]) { $ispresent = 'true'}; }; if ($ispresent =='false') { ##if not add it to @list2 push @list2, $random; $count--; }; }; #### $list_of_teamdata[7][1] #### @row; $rowcount = 0; while (@row = $sth5->fetchrow_array()) { $round = $row[0]; $teamname = $row[1]; ## need to put each row into the list. $Score = $row[2]; of lists a variable at a time push (${list_of_teamdata[$rowcount]}, qw($round $teamname $score); $rowcount++; }