my $bar = ${exist $foo{'bar'}{'baz'} or \undef};