my $file="service.xml"; my $xml = new XML::Simple; my $data = $xml->XMLin("$file", ForceArray =>['Service','SystemReaction','Customers','Suppliers','SW','HW'],); print Dupmer ($data); #### $var1={ 'Service' => [ { 'Suppliers' => [ { 'SW' => [ { 'Path' => '/work/service.xml', 'Service' => 'b7a' }, { 'Path' => '/work/service1.xml', 'Service' => 'b7b' }, { 'Path' => '/work/service2.xml', 'Service' => 'b5' } ] } ], 'Id' => 'SKRM', 'Customers' => [ { 'SW' => [ { 'Path' => '/work/service.xml', 'Service' => 'ASOC' } ] } ], 'Des' => 'Control the current through the pipe', 'Name' => ' Control unit' }, { 'Suppliers' => [ { 'HW' => [ { 'Type' => 'W', 'Path' => '/work/hardware.xml', 'Nr' => '18', 'Service' => '1' }, { 'Type' => 'B', 'Path' => '/work/hardware.xml', 'Nr' => '7', 'Service' => '1' }, { 'Type' => 'k', 'Path' => '/work/hardware.xml', 'Nr' => '1', 'Service' => '1' } ] } ], 'Id' => 'ADTM', 'Customers' => [ { 'SW' => [ { 'Path' => '/work/service.xml', 'Service' => 'SDCR' } ] } ], 'Des' => 'It delivers actual motor speed', 'Name' => ' Motor Drivers and Diognostics' }, ] 'Systemreaction'=>[ { ------- ------- ------- } { ------- ------- ------- }, ] };