It depends on whether or not you consider the empty string "something". You didn't assign anything to your test variable above, so it is undefined. But the undefined value evaluates to false in a boolean context, the empty string in a string context, and zero in numerical context (although you get an uninitialized warning in the last two with warnings on). If you want your hash values in the OP to be undefined, then assign
undef instead of the empty string. Or, always initialize your variables (to the empty string if necessary), and compare to the empty string.