use strict; use warnings; use 5.010; my %hash = ( 'one' => undef, ); say "The key 'one' exists" if exists $hash{one}; say "The key 'two' exists" if exists $hash{two}; --output:-- The key 'one' exists