in reply to Choosing a random product from an Array

I would suggest to use a bit map to figure out the diff between two arrays:
@a = (10, 2, 3, 5, 89); @b = (2, 5); my $c = []; foreach (@a) { $c[$_] = $_; }; foreach (@b) { $c[$_] = undef; } foreach (0 .. $#{@c}) { print "$c[$_]\n" if (defined($c[$_])); }