develooper Front page | perl.beginners | Postings from April 2002

FW: Scripts picks random elements from array , but it repeats sometimes

Thread Next
From:
FLAHERTY, JIM-CONT
Date:
April 29, 2002 11:58
Subject:
FW: Scripts picks random elements from array , but it repeats sometimes
Message ID:
6D0317C617A8D3119EC000A0C9FC45240190AB8E@kinx68322m1.cnet.navy.Mil
 
Hello , My script picks out random elements from an array , but it sometimes
repeats ( which is no good) .. I want to prevent this , Do I delete the
element from the array .... or is there a better way ? And how do I do
either ?  
 
 
 
my mistake here is the code 
 
 
 
 
while($numofques > 0) {
    $index   = rand @numbers;
    $element = $numbers[$index];
 
 
 

 
 
 
 
 
Thanks 
Jim

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About