foreach my $k1 (keys %var) { foreach my $k2 (keys %{$var{$k1}}) { print('$var{$k1}{$k2}=', $var{$k1}{$k2}, "\n"); } }