App-pltest

 view release on metacpan or  search on metacpan

pod/examples.pod  view on Meta::CPAN

    pltest -aB '$RESULT = "inf"' '$RESULT = min $RESULT, @FIELD' file*

Likewise for overall maximum, you start with negative infinity:

    pltest -aB '$RESULT = "-inf"' '$RESULT = max $RESULT, @FIELD' file*

=item Median, Quartiles, Percentiles

The median is the number where half the list is less and half is greater.
Similarly the 1st quartile is where 25% are less and the 3rd where 25% are
greater.  Use a list slice to extract these 3 and a 97th percentile, by
multiplying the fractional percentage with the list length:

    pltest -A 0..200 'echo @ARGV[map $_*@ARGV, .25, .5, .75, .97]'

If you'd rather have names associated, assign them to hash slice in
sort-numerically-at-end C<%N(UMBER)>, whose key order must match the
percentages:

    pltest -A 0..200 '@NUMBER{qw(lower median upper 97.)} = @ARGV[map $_*@ARGV, .25, .5, .75, .97]'

=item Triangular Number, Factorial and Averages

I<80% of people consider themselves to be above average. :-)>

The triangular number is defined as the sum of all numbers from 1 to I<n>, e.g. 1
to 5.  Factorial is the equivalent for products:



( run in 0.358 second using v1.01-cache-2.11-cpan-709fd43a63f )