in reply to Data::Dumper and eval

If there's a possibility that your file is empty, you need an extra step:
open DATA, "<$datafile" or die "$!"; my $dumped_hash; { local $/; $dumped_hash = <DATA>; } my %somehash; %somehash = %{ eval $dumped_hash } if $dumped_hash;
That way, %somehash is empty and you'll avoid those errors if there's nothing in the file.

Update: jcwren pointed out that I had an extra line that should have been edited out. I dare you to find it now.