my $variable = $some_unknown_input || 'default'; my $foo = (defined $input ? $input : '');