RE: Randomizing lines in a file: problems with hashes

2001-12-19 Thread KEVIN ZEMBOWER
] > Sent: Wednesday, December 19, 2001 11:06 AM > To: [EMAIL PROTECTED] > Subject: Randomizing lines in a file: problems with hashes > > > I need to take a file of alphabetized lines (one line per record) and > randomize it. I thought one way of doing this was to read i

RE: Randomizing lines in a file: problems with hashes

2001-12-19 Thread Bob Showalter
> -Original Message- > From: KEVIN ZEMBOWER [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, December 19, 2001 11:06 AM > To: [EMAIL PROTECTED] > Subject: Randomizing lines in a file: problems with hashes > > > I need to take a file of alphabetized lines (

Re: Randomizing lines in a file: problems with hashes

2001-12-19 Thread David Shrewsbury
Change %randomarray = ($key => $_); to $randomarray{$key} = $_; -David On Wed, 2001-12-19 at 11:05, KEVIN ZEMBOWER wrote: > I need to take a file of alphabetized lines (one line per record) and > randomize it. I thought one way of doing this was to read in the file, > one line at a tim

Randomizing lines in a file: problems with hashes

2001-12-19 Thread KEVIN ZEMBOWER
I need to take a file of alphabetized lines (one line per record) and randomize it. I thought one way of doing this was to read in the file, one line at a time, generate a random number and store the line in a hash with the random number as the key. After all the lines were read in, I'd output eac