in reply to Wrong Results in checking if hash value is defined or not

From perldoc perlfunc, on the entry for “defined()”:

When used on a hash element, it tells you whether the value is defined, not whether the key exists in the hash.   Use "exists" for the latter purpose.