/usr/share/doc/crossroads/examples/xr-analyze-test is in crossroads 2.81-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 | #!/usr/bin/perl
use strict;
my $n = 0;
my $tot = 0;
my @num;
while (my $line = <STDIN>) {
next unless ($line =~ /^\d/);
$tot += $line;
push(@num, $line);
$n++;
}
exit(1) if ($n < 2);
my $avg = $tot / $n;
my $sumsq = 0;
for my $n (@num) {
my $diff = $n - $avg;
$sumsq += ($diff * $diff);
}
print ("Total : $n\n",
"Average : ", $avg, "\n",
"SD : ", sqrt($sumsq / ($n - 1)), "\n");
|