use Data::Dumper; my %hash = qw( foo one bar two baz three ); open DATA, ">whatever.dat"; print DATA Dumper(\%hash); close DATA; my %hash2 = %{ do "whatever.dat" }; print Dumper(\%hash2); __output__ $VAR1 = { 'foo' => 'one', 'baz' => 'three', 'bar' => 'two' };