Head1 Head2 Head3 Head4 Head5 Head6 Head7 Head8 Head9 Head10 Head11 1 0 1 1 0 0 0 0 0 0 1 2 0 0 0 0 0 0 0 1 0 0 3 1 0 0 0 1 0 0 0 1 0 #### sub find_and_remove () { # pulls the referenced array into the subroutine and saves it in variable $reference $reference = $_[0]; # selects a random number from array size. $random_number = int(rand(@col2c)); # saves that-numbered variable from the array as $nowvalue $nowvalue = @$reference[$random_number]; # removes the variable from the array so it can't be selected again splice (@$reference, $random_number, 1); # returns the selected value return $nowvalue; }