in reply to How to compute the avg of a column of numbers

You can also use List::Util to get the sum, and then divide by the number of elements using scalar @array.
#!/usr/bin/perl use strict; use warnings; use List::Util qw( sum ); my @box = ( 100, 200, 300 ); my $average = (@box) ? (sum (@box) / scalar @box) : 0 ; print $average, "\n";
neniro

Oh, i missed Art_XIVs node, suggesting the same.