note
fergal
<b>Update:</b> Nonsense below, I misread the post.
<p>
<blockquote>It would be much more useful, or sensible, if hash in a scalar context returned the number of keys:
</blockquote>
As soon as you try to use it as a number, "2/8" will be numified to 2 so actually it does effectively return the number keys.
<code>
perl -le '%h = (a =>1, b => 2); print %h+0'
2
</code>
The number of buckets is some bonus info for free.
435338
435351