Peter Hicks wrote in post #996483:
>
> What is the magic I am missing?
>

clone():

b = [ { :x => "foo" }, { :x => "bar" }, { :x => "baz" } ]
count = 0

b.each do |x|
  copy = x.clone
  copy[:x] = count
  count += 1

  puts copy[:x]
end

b.each do |x|
 p x
end

--output:--
0
1
2
{:x=>"foo"}
{:x=>"bar"}
{:x=>"baz"}

-- 
Posted via http://www.ruby-forum.com/.