#!/usr/bin/perl use strict ; my %struct ; $struct{foo}{1} = "one" ; $struct{bar}{2} = "two" ; foreach my $hash ( keys (%struct) ) { print "$hash \n"; foreach my $key ( keys ( %{$struct{$hash}} ) ) { print "\t$key \n" ; } }