in reply to Get total number of characters in a hash (not memory usage)

perl -le '$h={"key"=>"value"}; $sum += length foreach (keys %$h, values %$h); print $sum'