use XML::Smart ; my $xml = new XML::Smart() ; $xml->{hash} = \%t_type ; $xml->save('hash.xml') ; my $xml_load = new XML::Smart('hash.xml') ; my %t_type_load = %{ $xml_load->tree_ok->{hash} } ; use Data::Dumper ; print Dumper( \%t_type_load ) ;