in reply to Re: Re: Data Dumper Examples
in thread Data Dumper Examples

Make certain you're dumping a single value. This is because do is evaluating the file and returning the last thing evaluated, which in the case of a single dumped hashref should be the hashref itself e.g
shell> perl -MData::Dumper -e 'my %h = qw/foo bar baz quux/; print Dumper \%h' > h.dump shell> cat h.dump $VAR1 = { 'foo' => 'bar', 'baz' => 'quux' }; shell> perl -MData::Dumper -e 'my $h = do "h.dump"; print Dumper $h' $VAR1 = { 'foo' => 'bar', 'baz' => 'quux' };
Note that I'm using a hash ref there, not a hash. You'll also want to turn on $Data::Dumper::Terse if you're running with strict 'vars' as it'll choke on $VAR1.
HTH

_________
broquaint