in reply to Data::Dumper and eval

I would do this rather differently:
my $href = do $datafile; if (not $href) { if ($!) { die "Cannot eval $datafile: $!"; } else { $href = {}; } } my %hash = %$href;