title: How can I read Perl data structures from Python?
body: <p>I've often seen people use Perl data structures in lieu of configuration files; i.e. a lone file containing only:</p>
  
  <pre><code>%config = (
      'color' =&gt; 'red',
      'numbers' =&gt; [5, 8],
      qr/^spam/ =&gt; 'eggs'
  );
  </code></pre>
  
  <p>What's the best way to convert the contents of these files into Python-equivalent data structures, using pure Python? For the time being we can assume that there are no real expressions to evaluate, only structured data.</p>