in reply to How to compute the avg of a column of numbers
my $total=0; map($total+=$_,@values); my $average = @values ? $total / @values : 0; [download]