title: perl hash of hashes or array of arrays example
body: <p>How come I never see examples like these where you declare the hash, and then put then inside another hash?</p>
  
  <pre><code>my %hash1={};
  $hash1{'key1'}='1-111';
  $hash1{'key2'}='1-222';
  $hash1{'key3'}='1-333';
  my %hash2={};
  $hash2{'key1'}='2-111';
  $hash2{'key2'}='2-222';
  $hash2{'key3'}='2-333';
  
  my %main_hash1={%hash1, %hash2};
  </code></pre>
  
  <p>I've only seen examples like these where they put the hashes inside the hash, instead of a variable for the hash:</p>
  
  <pre><code>my %main_hash2=( 'hash1' =&gt; {
                              'key1' =&gt; '1-111',
                              'key2' =&gt; '1-222',
                              'key3' =&gt; '1-333'
                      },
               'hash2' =&gt; {
                              'key1' =&gt; '2-111',
                              'key2' =&gt; '2-222',
                              'key3' =&gt; '2-333'
                      }
  );
  </code></pre>
  
  <p>(similar with arrays also)</p>