undef is missing. defined asks whether a scalar has a value.
Goal
Say whether a city is set, then fill a default.
use strict;
use warnings;
use feature 'say';
my $city;
say defined $city ? "set" : "missing";
$city = "Nairobi";
say defined $city ? $city : "missing";use strict;
use warnings;
use feature 'say';
my $note;
say $note // "none";
$note = "busy";
say $note // "none";use strict;
use warnings;
use feature 'say';
my %row = (city => "Kisumu");
say defined $row{units} ? $row{units} : 0;use strict;
use warnings;
use feature 'say';
my $units = 0;
say defined $units ? "defined" : "undef";
say $units ? "truthy" : "zero";