Let\'s say I have a text file created using Data::Dumper, along the lines of:
my $x = [ { foo => \'bar\', asdf => undef }, 0, -4, [ [] ] ];
By default, Data::Dumper output cannot be parsed by eval, especially if the data structure being dumped is circular in some way. However, you can set
$Data::Dumper::Purity = 1;
or
$obj->Purity(1);
where obj
is a Data::Dumper object. Either of these will cause Data::Dumper to produce output that can be parsed by eval.
See the Data::Dumper documenatation at CPAN for all the details.