use strict; use warnings; my $nested = { 'Systemreaction' => [ { 'Data' => 'x' }, { 'Data' => 'x' } ], 'Service' => [ { 'Customers' => [ { 'SW' => [ { 'Path' => '/work/service.xml', 'Service' => 'ASOC' } ] } ], 'Id' => 'SKRM', 'Name' => ' Control unit', 'Suppliers' => [ { 'SW' => [ { 'Path' => '/work/service.xml', 'Service' => 'b7a' }, { 'Path' => '/work/service1.xml', 'Service' => 'b7b' }, { 'Path' => '/work/service2.xml', 'Service' => 'b5' } ] } ], 'Des' => 'Control the current through the pipe' }, { 'Customers' => [ { 'SW' => [ { 'Path' => '/work/service.xml', 'Service' => 'SDCR' } ] } ], 'Id' => 'ADTM', 'Name' => ' Motor Drivers and Diognostics', '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' } ] } ], 'Des' => 'It delivers actual motor speed' } ] }; for my $service (@{$nested->{'Service'}}) { print "$service->{'Name'}\n"; } for my $system (@{$nested->{'Systemreaction'}}) { print "$system->{'Data'}\n"; }