# If velocity is defined, use it, otherwise don't. # Note that just the concatenation arg is guarded, # so you still get an error if $b is not a hashref. $a = $b->{'velocity'}^^ . ' mph' // 'unknown'; # Safe dereferencing of $d (it may be undefined). # Note that the second dereference is normal, # so parent() returning undef would trigger an error. $c = $d^^ -> parent -> name; # Safe dereferencing of $d (it may be undefined). # Note that the second dereference is normal, # so a nonexistent 'parent' component would be created. $c = $d^^ ->{'parent'}->{'name'};