Challenge 3: exists vs Truthiness — Possible Solution ==================================================================== use strict; use warnings; use feature 'say'; my %inventory = ("apples" => 5, "bananas" => 0); if ($inventory{"bananas"}) { say "Truthiness check: bananas present"; } else { say "Truthiness check: bananas NOT present"; } if (exists $inventory{"bananas"}) { say "exists check: bananas present"; } else { say "exists check: bananas NOT present"; } Output: Truthiness check: bananas NOT present exists check: bananas present WHY THIS WORKS AS AN ANSWER ------------------------------ if ($inventory{"bananas"}) reuses plain scalar truthiness — in Perl, 0 is a false value, exactly like in most languages. Since $inventory{"bananas"} IS 0 (a legitimately stored value, not a missing key), this check evaluates to false, printing "NOT present" — even though the key genuinely exists in the hash. if (exists $inventory{"bananas"}) reuses the chapter's own exists function directly, which the chapter's own warn-box describes as answering "is this key present at all, independent of whatever value it happens to hold." Since "bananas" WAS added to %inventory (with the value 0), exists correctly reports it as present, regardless of that value being falsy. One-sentence explanation: the two checks answer genuinely different questions — plain truthiness asks "is this value truthy" (and 0 isn't), while exists asks "is this key actually in the hash" (and it is) — so a key stored with a legitimately falsy value like 0 will always disagree between the two, exactly the trap the chapter's own newborn-age example warns about.