my %ten;
$ten{ rand() } = undef until scalar keys %ten == 10;
print "$_\n" for keys %ten;

Keep in mind, as Randy Sims pointed out, rand() is not truly random, but it
is random enough for me.
;-) 

-----Original Message-----
From: N, Guruguhan (GEAE, Foreign National, EACOE)
[mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 27, 2004 5:37 AM
To: Zeus Odin; [EMAIL PROTECTED]
Subject: RE: [SOLUTION] how can i generate 10 unique (non repeating) numbers

Hi Zeus,
             Your code and explanation are good. Incase I want 10 non
repeated random numbers between 0 and 1 what needs to be done? 



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to