title: Perl: Read/Reverse Data Dumper back into an array
body: <p>My goal is to read a string back into an array ref.</p>
  
  <p>I modified the example code <a href="http://www.perlmonks.org/?node_id=845672" rel="nofollow">here</a>. The example on that site uses a Hash and in my case I want to use an Array. Here is what I tried:</p>
  
  <pre><code>use strict;
  use warnings;
  
  # Build an array with a hash inside
  my @test_array = ();
  my %test_hash = ();
  $test_hash{'ding'} = 'dong';
  push @test_array, \%test_hash;
  
  # Get the Dumper output as a string
  my $output_string = Dumper(\@test_array);
  
  # eval_result should be an array but is undef
  my @eval_result = @{eval $output_string};
  </code></pre>
  
  <p>Running this code produces this error:</p>
  
  <pre><code>Can't use an undefined value as an ARRAY reference at
          /var/tmp/test_dumper.pl line 30 (#1)
      (F) A value used as either a hard reference or a symbolic reference must
      be a defined value.  This helps to delurk some insidious errors.
  
  Uncaught exception from user code:
          Can't use an undefined value as an ARRAY reference at /var/tmp/test_dumper.pl line 30.
   at /var/tmp/test_dumper.pl line 30.
          main::test_array_dump() called at /var/tmp/test_dumper.pl line 14
  </code></pre>
  
  <p>If I remove the <code>use strict;</code> pragma, the error goes away and I get the expected array.</p>
  
  <p>What is the correct way to get an array variable from a Dumper output?</p>