title: Merging hashes containing common keys and values, perl
body: <p>For example, we have two hashes. We don't know their size, but we know that they have common data</p>
  
  <pre><code>%h1 = (
      k1 =&gt; (a =&gt; "a1",
             b =&gt; "b1"),
      k2 =&gt; (a =&gt; "a2",
             b =&gt; "b2")
      k3 =&gt; (a =&gt; "a3",
             b =&gt; "b3"),
      k4 =&gt; (a =&gt; "a4",
             b =&gt; "b4")
  );
  %h2 = (
      k2 =&gt; (c =&gt; "c2",
             b =&gt; "b2"),
      k3 =&gt; (c =&gt; "c3",
             b =&gt; "b3")
      k4 =&gt; (c =&gt; "c4",
             b =&gt; "b")
  )
  </code></pre>
  
  <p>How to merge them to get something like this?
  Note, that exact keys are unknown, but has common keys-values.</p>
  
  <pre><code>%h3 = (
          k1 =&gt; (a =&gt; "a1",
                 b =&gt; "b1",
                 c =&gt; "0"),
          k2 =&gt; (a =&gt; "a2",
                 b =&gt; "b2",
                 c =&gt; "c2"),
          k3 =&gt; (a =&gt; "a3",
                 b =&gt; "b3",
                 c =&gt; "c3"),
          k4 =&gt; (a =&gt; "a4",
                 b =&gt; "b4",
                 c =&gt; "c4")
      )
  </code></pre>