#!/usr/bin/perl -w use strict; use Statistics::Descriptive::LogScale; my $stat = Statistics::Descriptive::LogScale->new (); while(<>) { chomp; $stat->add_data($_); }; # This can also be done in O(1) memory, precisely printf "Average: %f +- %f\n", $stat->mean, $stat->standard_deviation; # This requires storing actual data, or approximating foreach (0.5, 1, 5, 10, 25, 50, 75, 90, 95, 99, 99.5) { printf "Percentile($_): %f\n", $stat->percentile($_); };