http://www.perlmonks.org?node_id=1022125


in reply to Dynamic thresholds in report

I found what I needed here Using the standard deviation and the 68–95–99 rule I had my dynamic thresholds.
sub stdev{ my($data) = @_; if(@$data == 1){ return 0; } my $average = &average($data); my $sqtotal = 0; foreach(@$data) { $sqtotal += ($average-$_) ** 2; } my $std = ($sqtotal / (@$data-1)) ** 0.5; return $std; }