Thank you, David, for giving me a fish, and Bob, for teaching me to
fish. It works like a charm.

Thanks, again.

-Kevin Zembower

>>> Bob Showalter <[EMAIL PROTECTED]> 12/19/01 11:21AM >>>
> -----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 (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 each line, sorted by the key (the random 
> number). 
>
> ...
> 
> Is there an easier/faster/better way of doing this that a perl guru
> would use?

There's a FAQ entry related to this:

perldoc -q 'How do I shuffle an array randomly?'

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, e-mail: [EMAIL PROTECTED] 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to