foreach my $key (keys %{$abc}) { if ( ref $abc->{$key} eq 'HASH' ) { } }