if (exists $hash{'d'} && ref $hash{'d'} eq "HASH" && exists $hash{'d'}->{value}) { ... }