title: Perl: How to push key/value pair onto hashref and still retain reference
body: <pre><code>$a = {b=&gt;{c=&gt;1}};   # set up ref
  $b = $a-&gt;{b};       # ref the ref
  $b .= (d=&gt;1,e=&gt;1);  # where we want to assign multiple key/val at once
  </code></pre>
  
  <p>At the end of it <code>$a</code> should look like:</p>
  
  <ul>
  <li><pre><code>{
    'b' =&gt; {
             'c' =&gt; 1,
             'd' =&gt; 1,
             'e' =&gt; 1
           }
  };
  </code></pre></li>
  </ul>
  
  <p>At the end of it <code>$b</code> should look like:</p>
  
  <ul>
  <li><pre><code>{
    'c' =&gt; 1,
    'd' =&gt; 1,
    'e' =&gt; 1
  }
  </code></pre></li>
  </ul>
  
  <hr>
  
  <p><em><strong>Note:</strong> it would be the same as doing:</em></p>
  
  <pre><code>$b-&gt;{d} = 1;
  $b-&gt;{e} = 1;
  </code></pre>
  
  <hr>
  
  <p><code>$b = { %$b, d=&gt;1, e=&gt;1 };</code> Is not desired because it creates a copy of <code>$a</code> and loses the reference.</p>