Array-APX

 view release on metacpan or  search on metacpan

lib/Array/APX.pm  view on Meta::CPAN

    use strict;
    use warnings;
    use Array::APX qw(:all);

    my $x = iota(100) + 1;
    my $f = sub { $_[0] + $_[1] };

   print $f/ $x, "\n";

calculates the sum of all integers between 1 and 100 (without using Gauss'
summation formula just by repeated addition). The combined operator

    $f/

applies the function referenced by $f between each two successive elements 
of the APX structure on the right hand side of the operator.

=cut

sub reduce
{



( run in 1.150 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )