http://search.cpan.org/~shlomif/Statistics-Descriptive-3.0612/lib/Statistics/Descriptive.pm
use Statistics::Descriptive;
my @a=(100,88,77,18,79,96,57,88,65,78,66,99);
my $stat = Statistics::Descriptive::Full->new();
$stat->add_data(@a);
my $mean = $stat->mean();#平均值
my $variance = $stat->variance();#方差
my $num = $stat->count();#data的数目
my $standard_deviation=$stat->standard_deviation();#标准差
my $sum=$stat->sum();#求和
my $min=$stat->min();#最小值
my $mindex=$stat->mindex();#最小值的index
my $max=$stat->max();#最大值
my $maxdex=$stat->maxdex();#最大值的index
my $range=$stat->sample_range();#最小值到最大值
print "Number of Values = $num
",
"Mean = $mean
",
"Variance = $variance
",
"standard_deviation = $standard_deviation
",
"sum =$sum
",
"min =$min
",
"mindex=$mindex
",
"max=$max
",
"maxdex=$maxdex
",
"range=$range
";