From: Todd Benson Date: 2009-04-27T11:56:18+09:00 Subject: Re: How to parse a "line"? On Sun, Apr 26, 2009 at 9:47 PM, Todd Benson wrote: > > In that case, you might try... > > h = {} > f = my_string_list.each_line do |line| > key = (value = line.split).shift > h[key] = value > end > > ...or something like that. It's late and I'm golfing with myself. Apologies to the list for this almost one-liner... h = {} s.each_line{|i|h[(v=i.split).shift]=v}