#!/usr/bin/perl use strict; use warnings; my %hash = (); my $max = 60_000; my $count = 700; while(keys(%hash) < $count-1){ $hash{int rand($max)} = 1; } print scalar(keys(%hash)); print $_,"\n" for(keys(%hash));