in reply to Data::Dumper and eval

Caveat: I'm guessing you're not using strict? When testing some code like this, eval would die because $VAR1 was not declared.

I would make your eval code a little more robust, to check for errors in the eval'd structure.

use strict; use Data::Dumper; my %somehash; open DATA, "$ARGV[0]" or die "$!"; { local $/; my $code = <DATA>; my $VAR1 = eval $code; if($@) { die "eval: $@\n"; } %somehash = %$VAR1; } print Dumper(\%somehash);
This is a nasty hack and not a good solution to persistance however ;)