- or download this
$a = "default" unless defined $a;
$h{key} = "value" unless exists $h{key};
- or download this
$a = "default" unless $a;
$h{key} ||= "value";
- or download this
my $a_val = defined $a ? $a : "default";
my $h_key_val = exists $h{key} ? $h{key} : "value";
- or download this
my $a_val = $a || "default";
my $h_key_val = $h{key} || "value";
- or download this
sub do_stuff
{
...
# now join the two, giving precedence to %raw_args
my %args = ( %default_args, %raw_args );
}