That whole while
loops is unnecessary. You just need
die if !exists($him->{ $c->{$d} });
my $mine = $him->{ $c->{$d} };
You might prefer
# If doesn't exist or isn't defined
die if !defined($him->{ $c->{$d} });
my $mine = $him->{ $c->{$d} };
or
# If doesn't exist, isn't defined, or is false.
die if !defined($him->{ $c->{$d} });
my $mine = $him->{ $c->{$d} };