use strict; use warnings; use List::Util('sum'); ## Store the hash value my %hash = ( 'A' => 46, 'D' => 18, 'C' => 17, 'B' => 31 ); ## values %hash -> gives the values of the hash ## keys %hash -> get number of element in this hash my $sum = sum (values %hash)/keys %hash; print $sum;