in reply to Accessing data in a Hash of Arrays

print $getConfigurationsResults->{Configuration}[1]{ConfItems}{ConfQty}[0]{ConfItem}{Fuel}{ConfItemName}

or possibly

for my $first (@{$getConfigurationsResults->{Configuration}}) { next unless $first->{ConfItems}; for my $second (@{$first->{ConfItems}{ConfQty}}) { print $second->{ConfItem}{Fuel}{ConfItemName}, "\n"; } }

See perllol.


#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Replies are listed 'Best First'.
Re^2: Accessing data in a Hash of Arrays
by azamatsmith (Initiate) on Apr 26, 2013 at 08:08 UTC

    Thanks Kennethk! This was exactly what I was needing help with and it worked perfectly:

    for my $first (@{$getConfigurationsResults->{Configuration}}) { next unless $first->{ConfItems}; for my $second (@{$first->{ConfItems}{ConfQty}}) { print $second->{ConfItem}{Fuel}{ConfItemName}, "\n"; } }