On 29-sep-2007, at 15:40, kazaam wrote:

> but how to achieve this? any idea or suggestion?

1) You parse the thing into a hash
2) You use a sprinkle of _why's Ruby magick to structify a hash

class H < Hash
     def method_missing(m,*a)
         m.to_s=~/=$/?self[$`]=a[0]:a==[]?self[m]:super
     end
end

  H[{:foo=>"bar"}].foo #=> "bar"

When mixed with your  task, remember that you can pass a zipped array  
to Hash[] (zipped means [key, val, key, val, ...]), using the splat (*).
So for your person entry the example becomes:

entry = text_of_a_single_person_entry
H[ *entry.split("\n").map{|line| line.split(/\=/) }.flatten.map{|  
key_or_val | key_or_val.strip } ]

-- 
Julian 'Julik' Tarkhanov
please send all personal mail to
me at julik.nl