my $elt; my %hash; @hash{@two} = (); $elt = $one[rand @one] until $elt and not $hash{$elt};