List-Pairwise

 view release on metacpan or  search on metacpan

lib/List/Pairwise.pod  view on Meta::CPAN

which the expression evaluated to true.
In scalar context, returns 1 if a valid pair was found.

C<firstp> can be used to iterate lists pairwise as does C<mapp>, but with
the additional option of using the value returned by the BLOCK as a C<last>
statement

    my $i;
    firstp {
        print "$a: $b\n";
        ++$i==5 # last after 5 iterations
    } %hash;

=item lastp BLOCK LIST

=item last_pairwise BLOCK LIST

Evaluates the BLOCK in scalar context for each pair of LIST (locally
setting $a and $b to each pair) and returns the last pair for
which the expression evaluated to true.
In scalar context, returns 1 if a valid pair was found.



( run in 0.758 second using v1.01-cache-2.11-cpan-5511b514fd6 )