> -----Original Message----- > From: FLAHERTY, JIM-CONT [mailto:Jim.Flaherty@cnet.navy.mil] > Sent: Monday, April 29, 2002 2:58 PM > To: Beginners (E-mail) > Subject: FW: Scripts picks random elements from array , but it repeats > som etimes > > > > 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]; Perhaps you want a shuffle; i.e. put the elements in random order and then iterate through the list. Can't say without more info on what you mean by "[repeating is] no good". perldoc -q shuffleThread Previous