in reply to Effect of scalar function on hash
Note that scalar(%h) can be unreliable for tied hashes, especially prior to 5.8.3. Before then, the result usually depended on the content of the hash before it was tied (which means it would typically be false).
Beginning in 5.8.3, if a SCALAR method is supplied, the result will be whatever that returns. Without SCALAR, perl makes a guess about whether
the hash has content and returns a simple true or false, with the idea that at least if (%h) should work where possible. (The only case where this guess is wrong is if you've iterated through the hash with each() and deleted every returned key, but not yet gotten an undef from each().)