Hi,

(reposting this since i did not see the original in my newsreader or google)

I want to generate  10 numbers from 1..15 and put them in an array.

easy ?
while ($fill < 10){
 $foo = int(rand(15));
 unshift(@array, $foo);
$fill++;
}
print "the [EMAIL PROTECTED] is --> @array\n";

my problem is that many times the numbers repeat themselves in the array.

the @array is --> 5 10 8 3 0 13 14 9 0 10

how can i generate 10 unique (non repeating) numbers from a range to put in
the array ?

thanx.



---

Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.719 / Virus Database: 475 - Release Date: 7/18/2004



-- 
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