... chomp ($name); if (exists $phnums{$name}) { print $phnums{$name}; } else { print "Name $name does not exists in the hash."; }