Perl Advent Calendar 2010-12-24

'Twas the night before diffmas

by Jerrad Pierce

Although the venerable diff command handles code quite nicely, it is terrible at comparing natural language documents. Consequently there have been numerous attempts to solve this problem over the years. One, that does a rather good job is Text::ParagraphDiff. With it you can create an interactive web page of a two document diff as simply as:

% tdiff old.txt new.txt > delta.html

And thus we can see that there are more differences between the original and modern versions of the famous Christmas than most are aware. Unfortunately, this particular test case reveals a long-standing bug.

View Source (POD)