/usr/share/doc/libsvg-graph-perl/examples/frequency.pl is in libsvg-graph-perl 0.02-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | #!/usr/bin/perl
use strict;
use Statistics::Descriptive;
use Getopt::Long;
my $bin;
GetOptions('binsize|b=i' => \$bin);
my $stat = Statistics::Descriptive::Full->new;
while(<>){
chomp;
$stat->add_data($_);
}
if(!$bin){
my $max = $stat->max;
my $min = $stat->min;
$bin = int($max - $min);
}
my %f = $stat->frequency_distribution($bin);
print "#stat:mean\t".$stat->mean."\n";
print "#stat:quartile1\t".$stat->percentile(25)."\n";
print "#stat:median\t".$stat->median."\n";
print "#stat:quartile3\t".$stat->percentile(75)."\n";
print "#stat:standard_deviation\t".$stat->standard_deviation."\n";
foreach my $p (sort {$a <=> $b} keys %f){
print $p, "\t", $f{$p} || 0, "\n";
}
|