Algorithm-Diff-Apply
view release on metacpan or search on metacpan
lib/Algorithm/Diff/Apply.pod view on Meta::CPAN
conflicts are detected and can be optionally handed off to helper
subroutines for resolution.
=over 4
=item apply_diff ARRAY,DIFF
Applies the changes described by a diff to a copy of I<ARRAY>, which
is then returned. I<DIFF> is a diff generated by
C<Algorithm::Diff::diff()>, and I<ARRAY> must be an array of an
appropriate length. Both parameters are passed in as references.
Neither argument is modified.
In a scalar context, C<apply_diff()> returns a reference to the
permuted copy that's generated. In an array context, the permuted copy
is returned as an array value.
This version of the algorithm is simpler and quicker than the
full-blown plural form, and should be used if you're only ever going
to be applying one diff at once.
=item apply_diffs ARRAY,HASH
=item apply_diffs ARRAY,OPTIONS,HASH
Applies more than one diff to a copy of an array at once, manages
conflicts, and returns the permuted copy as either a reference or an
array depending on context.
I<ARRAY> must be a reference to an array value of an appropriate
length. The array behind the passed reference is not permuted.
The I<HASH> parameter contains diffs from different sources, as
generated by C<Algorithm::Diff::diff()>. The diffs are keyed by
arbitrary strings which should reflect their source.
See L<DIFF LABELS> for details of what these strings might reflect.
I<OPTIONS>, if specified, must be a hash reference of option keywords
and the corresponding parameters. The following options are
recognised:
( run in 0.624 second using v1.01-cache-2.11-cpan-65fba6d93b7 )