my $f = $h->{b}{c}{d} if exists($h->{b}{c}) and exists($h->{b}{c}{d});
This is dangerous: the nature of my $var = ... if ... is predictable but very noninuitive (it acts something like a state variable). It has long been regarded as a bug that perl core would dearly love to fix, but cannot due to back-compat.
I recommend always either splitting out the declaration from the assignment:
my $f;
$f = $h->{b}{c}{d} if exists($h->{b}{c}) and exists($h->{b}{c}{d});
.. or using state explicitly when that's what you actually intend:
use feature 'state'; # 'use 5.10' or later also gives this automatica
+lly
state $f = $h->{b}{c}{d} if exists($h->{b}{c}) and exists($h->{b}{c}{d
+});