title: How do I read back in the output of Data::Dumper?
body: <p>Let's say I have a text file created using <a href="http://perldoc.perl.org/Data/Dumper.html" rel="nofollow noreferrer"><code>Data::Dumper</code></a>, along the lines of:</p>
  
  <pre><code>my $x = [ { foo =&gt; 'bar', asdf =&gt; undef }, 0, -4, [ [] ] ];
  </code></pre>
  
  <p>I'd like to read that file back in and get <code>$x</code> back. I tried this:</p>
  
  <pre><code>my $vars;
  {
    undef $/;
    $vars = &lt;FILE&gt;;
  }
  
  eval $vars;
  </code></pre>
  
  <p>But it didn't seem to work -- <code>$x</code> not only isn't defined, when I try to use it I get a warning that</p>
  
  <blockquote>
    <p>Global symbol $x requires explicit package name.</p>
  </blockquote>
  
  <p>What's the right way to do this? (And yes, I know it's ugly. It's a quick utility script, not e.g., a life-support system.)</p>