title: Modifying a hash with multiple occurrences
body: <p><code>a</code> is a hash. <code>s</code> is an array where I want to push the hash <code>a</code> iteratively. The idea is to retain the value of each iteratively pushed hash independently. Here is what I tried.</p>
  
  <pre><code>a = {:a=&gt; 1, :b=&gt;2}
  
  s = []
  s &lt;&lt; a
  s &lt;&lt; a     # =&gt; [{:b=&gt;2, :a=&gt;1}, {:b=&gt;2, :a=&gt;1}]
  a[:b] = 3
  s          # =&gt; [{:b=&gt;3, :a=&gt;1}, {:b=&gt;3, :a=&gt;1}]
  
  t = []
  t.push(a)    # =&gt; [{:b=&gt;3, :a=&gt;1}]
  t.push(a)    # =&gt; [{:b=&gt;3, :a=&gt;1}, {:b=&gt;3, :a=&gt;1}]
  a[:b] = 4
  t            # =&gt; [{:b=&gt;4, :a=&gt;1}, {:b=&gt;4, :a=&gt;1}]
  </code></pre>
  
  <p>The above doesn't give me the solution: Changing <code>a</code> changes the values in the elements inside the array which were previously pushed. After pushing <code>a</code> to <code>s</code> twice, I changed <code>a[:b]</code> from <code>2</code> to <code>3</code>, and all the elements reflected the change. Suggestion for this please.</p>