I can generate random numbers between 1 and 52 but i want 9 differing numbers my code is below how can i ensure that all nine numbers are differant
MADAXE
Code:
my $lower=1;
my $upper=52;
my $random1 = int(rand( $upper-$lower+1 ) ) + $lower;
my $random2 = int(rand( $upper-$lower+1 ) ) + $lower;
my $random3 = int(rand( $upper-$lower+1 ) ) + $lower;
my $random4 = int(rand( $upper-$lower+1 ) ) + $lower;
my $random5 = int(rand( $upper-$lower+1 ) ) + $lower;
my $random6 = int(rand( $upper-$lower+1 ) ) + $lower;
my $random7 = int(rand( $upper-$lower+1 ) ) + $lower;
my $random8 = int(rand( $upper-$lower+1 ) ) + $lower;
my $random9 = int(rand( $upper-$lower+1 ) ) + $lower;
print header;
print start_html("MCJEEVES.NET");
print $random1,"\n";
print $random2,"\n";
print $random3,"\n";
print $random4,"\n";
print $random5,"\n";
print $random6,"\n";
print $random7,"\n";
print $random8,"\n";
print $random9,"\n";
print end_html;
MADAXE