Win8 Strawberry 5.8.9.5 (32) Wed 10/28/2020 15:06:58 C:\@Work\Perl\monks >perl -Mstrict -Mwarnings my $x; # undefined/false my $y = 'default string'; my $side; if (not $x) { $side = $y; } # true clause has side effect # $side = $y unless $x; # a more terse alternative printf "side effect '%s' logical-or '%s' ternary '%s' \n", $side, ($x || $y), $x ? $x : $y; ^Z side effect 'default string' logical-or 'default string' ternary 'default string'