scalar(%hash)
returns information about hash buckets. The first number indicates the number of occupied buckets in the hash storage and the second number indicates the total number of buckets allocated.
I wasn’t sure in my guess, until I got a confirmation from Perl monks, which also pointed me to the “man perldata” bit describing the result.