This is a module for computing the difference between two files, two
strings, or any other two lists of things.  It uses an  intelligent
algorithm similar to (or identical to) the one used by the Unix `diff'
program.   It is guaranteed to find the *smallest possible* set of

It was originally written by Mark-Jason Dominus, and was re-written and is now being maintained
by Ned Konz,

Mark-Jason still maintains a mailing list.
To join a low-volume mailing list for announcements related to diff
and Algorithm::Diff, send an empty mail message to

This package contains a few parts:

	Module that contains the `diff' function, which computes the
	differences betwen two lists and returns a data structure that
	represents these differences.  You can then use the data
	structure to generate a formatted output in whatever format you
	like.  The `diff' programs included in this package use
	Algorithm::Diff::diff to find the differences, and then theyjust
	format the output.  

	Algorithm::Diff also includes some other useful functions such
	as `LCS', which computes the longest common subsequence of two

	A::D is suitable for many other uses.  For example, you could
	use it for finding the smallest set of differences between two
	strings, or for computing the most efficient way to update the
	screen if you were replacing `curses'.

	An alternative module for those of you who HAVE to have the
	old interface (which uses a comparision function rather than
	a key generating function). Note that this is many times (20?)
	slower than Algorithm::Diff, because it has to do M*N comparisons
	rather than M+N key generations or so for Algorithm::Diff.
	Implementation of `diff' in Perl that is as simple as possible
	so that you can see how it works.  The output format is not
	compatible with regular `diff'.
	Implementation of Unix `diff' in Perl with full bells and
	whistles. By Mark-Jason, with code from included.
	`diff' that generates real context diffs in either traditional
	format or GNU unified format. Original contextless `context'
	diff supplied by Christian Murphy.  Modifications to make it
	into a real full-featured diff with -c and -u options supplied
	by Amir D. Karger.  

	Yes, you can use this program to generate patches.


`Longest Common Subsequences', at 

This code was adapted from the Smalltalk code of Mario Wolczko
<>, which is available at


Thanks to Mark-Jason Dominus for doing the original Perl version and
maintaining it over the last couple of years. Mark-Jason has been a huge
contributor to the Perl community and CPAN; it's because of people like
him that Perl has become a success.

Thanks to Mario Wolczko <> for writing and making
publicly available his Smalltalk version of diff, which this Perl
version is heavily based on.

Thanks to Mike Schilli <> for writing sdiff and
traverse_balanced and making them available for the Algorithm::Diff

(From Mark-Jason Dominus' earlier versions):

Huge thanks to Amir Karger for adding full context diff supprt to
`', and then for waiting patiently for five months while I let
it sit in a closet and didn't release it.  Thank you thank you thank
you, Amir!

Thanks to Christian Murphy for adding the first context diff format
support to `'.