$ perl -e'my %h; 1 for $h{k}; CORE::say 0+keys(%h)' 1 $ perl -e'my %h; 1 for $x // $h{k}; CORE::say 0+keys(%h)' 0