use XML::Simple; use Data::Dumper; $Data::Dumper::Indent = 1; my $config = XMLin(); print Dumper($config); #### $VAR1 = { 'Node' => [ { 'Type' => 'Module', 'No' => '1', 'File' => 'Sample1.pl', 'Description' => {}, 'Label' => 'AA' }, { 'Type' => 'Methods', 'No' => '2', 'File' => 'Sample1.pl', 'Description' => 'Initiator', 'Label' => 'BB' }, { 'Value' => [ { 'No' => '1', 'content' => 'Ignore' }, { 'No' => '2', 'content' => 'Retry' }, { 'No' => '3', 'content' => 'Abort' } ], 'Type' => 'Methods', 'No' => '3', 'File' => 'Sample2.pl', 'Description' => 'Destructor', 'Label' => 'CC' } ] };