# Print 10 random numbers between 0 and 100, without duplicates. my %seen; for (1 .. 10) { redo if $seen {my $r = int rand 100} ++; print "$r\n"; }