for my $k (keys %$VAR1){ # $k contains 'somethingunknown' or 'someothername' for my $aoh (@{ $VAR1->{$k} }){ print "$k has ", $aoh->{val2},"\n" } }