I take it back (again).  it does not appear that an array
is automatically converted into a hash.  sorry for talking
to myself in front of you all :-0

It looks like David A Black has written some ruby code to
make arrays turn into hashes:
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/~poffice/mail/ruby-talk/6663

but it's not in the core.  and if it is, and I find out, I
promise not to send another note on the subject notifying
everyone I was wrong again, someone else will have to do that.  ;-)

-joe


> -----Original Message-----
> From: Joseph McDonald [mailto:joe / vpop.net]
> Sent: Friday, December 15, 2000 9:05 PM
> To: ruby-talk ML
> Subject: [ruby-talk:7398] Re: Ruby performance question
> 
> 
> 
> color me wrong.  I must have had a typo when testing.  It sure does
> seem to fill in the hash.  Please ignore what I wrote below.
> 
> -joe
> 
> > -----Original Message-----
> > From: Joseph McDonald [mailto:joe / vpop.net]
> > Sent: Friday, December 15, 2000 9:02 PM
> > To: ruby-talk ML
> > Subject: [ruby-talk:7394] Re: Ruby performance question
> > 
> > 
> > 
> > Hi,
> > 
> > It is faster, but I don't think it is putting anything in the
> > hash.  I know perl will convert an array to a hash, but I don't
> > think ruby does it as a built-in.  Please correct me if I'm wrong.
> > 
> > regards,
> > -joe
> > 
> > > I found even another fastest version:
> > > 
> > >  def dt_readfile
> > >    h = Hash.new
> > >    file = File.new("keys")
> > >    while line = file.gets
> > >      record = line.chomp!.tr!('=', ',').split(',')
> > >      h = Hash.new(record)
> > >      # do stuff here...
> > >      h.clear
> > >    end
> > >  end
> > > 
> > > Park, Hee-Sob
> > 
>