use strict; use warnings; use Data::Dumper; our $phash = { "enabled" => "true", "honorold" => "true", "debug" => "false", "questsfull" => "false", "tooltipshtml" => "true", "lite" => "true", "scan" => { "inventory" => "true", "talents" => "true", "honor" => "true", "reputation" => "true", "spells" => "true", "pet" => "true", "equipment" => "true", "professions" => "true", "mail" => "true", "skills" => "true", "quests" => "true", "bank" => "true", }, "ver" => "10500", "reagenthtml" => "true", "talentsfull" => "true", }; # Save to a file my $fh; my $fname = "data.txt"; open($fh, ">", $fname) or die "Cannot write to '$fname' ($!)\n"; my $d = Data::Dumper->new([$phash], ['phash']); print $fh $d->Dump(); close $fh; # Time passes ... # Make the hash null, to verify that it's read from the file correctly $phash = 0; printf "Results of hash = %s\n", Dumper($phash); # Read back the file do $fname; printf "Results of hash = %s\n", Dumper($phash);