my $a_val = defined $a ? $a : "default"; my $h_key_val = exists $h{key} ? $h{key} : "value";