in reply to Accessing and performing calculations with elements of a hash

$sum += log_2($_) for values %hash

Cheers,
R.