http://www.perlmonks.org?node_id=73550

Galen has asked for the wisdom of the Perl Monks concerning the following question:

Is there a method for directly retrieving the size of a hash, or must I use an array?
%somehash = ( key1 => "value1", key2 => "value2", key3 => "value3, key4 => "value4", ); @keys = keys %somehash; $size = @keys; print "This hash holds $size key-value pairs\n";