http://www.perlmonks.org?node_id=943842


in reply to Re: How to access hash of arrays values using perl
in thread How to access hash of arrays values using perl

Sorry for not clearance post, I mean how to get nested elements, but I am facing difficult in getting "Type" and "Nr" values. can you help me with that, or give me some example.

Thanks for your reply

  • Comment on Re^2: How to access hash of arrays values using perl

Replies are listed 'Best First'.
Re^3: How to access hash of arrays values using perl
by TJPride (Pilgrim) on Dec 15, 2011 at 22:31 UTC
    Using my previous definition for $nested:

    for my $service (@{$nested->{'Service'}}) { for my $suppliers (@{$service->{'Suppliers'}}) { for my $hw (@{$suppliers->{'HW'}}) { print "Type: $hw->{'Type'}\n"; print "Nr: $hw->{'Nr'}\n"; } } }