use strict; use warnings; use Data::Dump::Streamer; my %services = ( 1 => { name => "service1", host => { host1 => 1 }, }, 2 => { name => "service2", host => { host0 => 2, host5 => 2 }, }, ); Dump (\%services); open TEMP, '>', 'temp.txt'; print TEMP Dump (\%services)->Out (); close TEMP; my $newServices = do 'temp.txt'; Dump ($newServices); #### $HASH1 = { 1 => { host => { host1 => 1 }, name => 'service1' }, 2 => { host => { host0 => 2, host5 => 2 }, name => 'service2' } }; $HASH1 = { 1 => { host => { host1 => 1 }, name => 'service1' }, 2 => { host => { host0 => 2, host5 => 2 }, name => 'service2' } };