my %hash = getHash(); if (%hash == undef) { print "undef\n"; } else { print "not undef\n"; }