# $p->items is a reference to an array # therefore @{$p->items} is an array. foreach (@{$p->items}) { # Now $_ is a reference to a hash. # You can get to the whole hash like this my @keys = keys %{$_}; # or access individual elements like this my $value = $_->{$keys[0]}; }