in reply to standard deviation accuracy question
Excel's STDEVP uses the n-1 as the denominator, so you should probably use
my $elements = $#ar; [download]