#!/usr/bin/perl use strict; use warnings; my %hash; $hash{anything} =1; my $hash_result = %hash; print "scalar value of a this hash = $hash_result\n"; __END__ PRINTS: scalar value of a this hash = 1/8 # scalar values of a hash is a string, like "1/8" # Means that 1 of 8 hash buckets is currently in use. # A Perl hash always starts with 8 hash buckets. # # Perl will double the number of hash buckets as it # sees fit. You have no control over that decision. # # Current versions of Perl have some randomization of # the keys -- a run with the exact same data may # result in a difference in # of keys used or total keys. # Of course the code above will always result in "1/8".