Hi all.
I'm trying to read in a hash reference dumped to a file with Data::Dumper via an eval with no success. After much frustration I've discovered this works fine in the debugger, but not in the code. I was hoping someone could explain why.
I know there are better ways to do this (Storable, etc.) but I need a plain text version of the data and, more importantly, I'd like to know why this happens differently in the debugger.
#perl v5.10.1
my $testdata;
open(DATA, "<filename") or die $!;
{
local $/;
$DB::single=1;
$testdata = eval <DATA>;
}
close DATA;
#testdata will be undefined
However, when using the debugger:
DB<2> $testdata = eval <DATA>;
DB<3> x $testdata
#outputs the expected data
Thanks for your time.