in reply to How to check whether a hash is empty (has no keys)?

keys, in scalar context returns the number of keys in the hash.
if( keys %hash ) { # There are keys } else { # There are no keys }