1. 随机打乱数组
use List::Util; @array = List::Util::shuffle @array;
2. 对数组取平均值,标准差等
use Statistics::Descriptive; my $stat = Statistics::Descriptive; $stat->add_data(@insert_size); my $mean = $stat->mean(); my $sd = $stat->standard_deviation(); my $sum = $stat->sum(); my $min = $stat->min(); my $max = $stat->max();