for my $key (keys %h){ for my $elem (@{ %h{$key} }){ print "$key: $elem\n"; } }