ANN: Algorithm::Diff version 1.10 released to CPAN 
Author Message
 ANN: Algorithm::Diff version 1.10 released to CPAN

There is a new version of the Algorithm::Diff module (v 1.10) available on
CPAN. It resides under the authors/id/N/NE/NEDKONZ/ directory (along with
my Archive::Zip module).  So, for instance, you can get it from the

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

Included is a version of the Unix diff utility that uses Algorithm::Diff
and produces compatible output.

This new version runs much faster and with much less memory consumption
than versions < 1.06 when comparing large arrays/files.

Version 1.10 is a bugfix version that makes the diff output truly minimal.
Unfortunately, this improvement also makes it somewhat slower.  But when
comparing two 4000-line files, it produces half the diff output. It now
produces output almost identical to GNU diff when that program is run with
the "-d" option.

Version 1.10 also adds Algorithm::DiffOld, which has the old interface but
runs much slower. Use this module ONLY if you can't use a key generating
function (like one user who was diffing an array of text with an array
of regular expressions).

If you're currently using a version of Algorithm::Diff prior to 1.06, please
note this interface change (from versions < 1.06):

There is one change to the interface: if you're passing a user-defined
comparison function, you'll have to change it to a function that generates
key strings instead.  This is used internally for comparison and key
generation (I use a hash for speed and the keys are used as keys into this

(If you HAVE to use the old interface, see the README for details on the
Algorithm::DiffOld module that is also distributed with this version.)

If you aren't passing a user-defined comparison function, Algorithm::Diff
should be a drop-in replacement. Specifically, if you're comparing strings,
there's probably nothing to change.

But if you're using objects or something more complex in the arrays, you'll
need to supply a key-generating function.

For example, if you're doing a case-insensitive diff, you might have had a
comparision function that looked like this:

        sub { lc($_[0]) eq lc($_[1]) }

for this new version, you'd change this to:

        sub { lc($_[0]) }

to supply a key for the strings instead.

Ned Konz
currently: Stanwood, WA

homepage:   http://www.*-*-*.com/ , Perl homepage: http://www.*-*-*.com/

Mon, 23 Dec 2002 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. ANNOUNCE: Algorithm::Diff v1.06 in CPAN (new version and maintainer)

2. ANNOUNCE: Algorithm::Diff v1.15 uploaded to CPAN

3. ANN: e:doc, the WYSIWYM frontend for Latex and HTML released in version 0.1.2

4. ANN: Archive::Zip version 0.10 on CPAN

5. ANN: XML::Parser Version 2.17 at CPAN

6. ANNOUNCE: Algorithm::Tree::NCA version 0.01 uploaded to CPAN

7. ObjStore 1.10 - Bug fix release!

8. Pod::Tree 1.10 released

9. CGI::Cache 1.10 released

10. Astro::Sunrise version 0.05 released to CPAN

11. Text::Template version 1.10 is available

12. ANN: Algorithm::Evolutionary 0.52_3


Powered by phpBB® Forum Software