in reply to How to have a subroutine return an undefined hash
Also note that getHash should return () rather than undef to give you an undefined hash. Returning undef will give you a malformed-but-defined hash.