if( keys %hash ) { # There are keys } else { # There are no keys }