title: How do I populate a hash (that has been defined in a separate file) in my Perl script and do necessary operations on it?
body: <p>How do I populate a hash (that has been defined in a separate file) in my Perl script and do necessary operations on it?</p>
  
  <p>For ex:</p>
  
  <p>file1.pl -- contains the defined hash,</p>
  
  <p>file2.pl -- user defined code that should populate the hash from file1.pl</p>
  
  <pre><code>my %tgs = (
      'articles' =&gt;  {
          'vim' =&gt; '20 awesome articles posted',
          'awk' =&gt; '9 awesome articles posted',
          'sed' =&gt; '10 awesome articles posted'
      },
  
      'ebooks' =&gt;  {
          'linux 101'   =&gt; 'Practical Examples to Build a Strong Foundation in Linux',
          'nagios core' =&gt; 'Monitor Everything, Be Proactive, and Sleep Well'
      },
  );
  </code></pre>