Array-Join
view release on metacpan or search on metacpan
lib/Array/Join/OO.pm view on Meta::CPAN
merge => 'LEFT_PRECEDENT',
}
);
my @rows = $join->join;
=head1 DESCRIPTION
C<Array::Join::OO> performs SQL-style joins over two Perl arrays.
Each array element is typically a hashref. Join keys are produced
by user-supplied callbacks.
The module supports C<inner>, C<left>, C<right>, and C<outer> joins
and multiple merge strategies for combining matching rows.
Multiple rows per key are supported; all matching combinations
are returned (Cartesian product).
=head1 CONSTRUCTOR
=head2 new( \@array_a, \@array_b, \%options )
lib/Array/Join/OO.pm view on Meta::CPAN
The options hash must contain an C<on> key with exactly two
code references, one per array.
=head3 Options
=over 4
=item * on => [ sub {...}, sub {...} ]
Required. Two callbacks that extract a join key from items in
the left and right arrays respectively.
=item * type => 'inner' | 'left' | 'right' | 'outer'
Join type. Defaults to C<inner>.
=item * merge => STR | ARRAY | CODE
Controls how matching rows are combined.
( run in 0.521 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )