in reply to How to address hashtables nested in arrays?

Hi benedicth,

You can access the values this way:

foreach my $n (@{$data->{instance}}) { foreach my $m (@{$n->{contact}}) { foreach my $key (keys %{$m}) { print "key: $key -> $m->{$key}\n"; } } }

Replies are listed 'Best First'.
Re^2: How to address hashtables nested in arrays?
by benedicth (Initiate) on Apr 11, 2015 at 21:07 UTC
    Thank you so much!! I'm still a newbie can you tell me why %{$data->{$m} does not work in this case?
      In this case both $n and $m contain hash reference but in %{$data->{$m}} $m should be a key.

      Try to run your script in perl debugger (perldebug) and check $n and $m using 'x' command for better understanding.