While writing a test suite for one of my applications today, I came across an interesting result. Perl’s scalar function, if given a hash as an argument, will return something like “2/8” or “5/16”. Results can be identical for different hashes. There is no obvioius trend in changing of these results. As it turned out,
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.