NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Algorithm::Diff, colored output (Score:1)
I also wanted to mention mjd's Algorithm:::Diff [cpan.org] (which Text::Diff [cpan.org] uses) in case that would help you find longest common sequences.
- Barrie
Re:Algorithm::Diff, colored output (Score:1)
I suspected someone like mjd would have worked this before...but taking a look at the two modules you reference, I can't immediately see how you'd apply them to a single file.
Re:Algorithm::Diff, colored output (Score:1)
You could also use it to diff the lines that were tweaked between the original code chunk and the copy-paste-tweaked code chunk. Lots of visual diffs do that sort of char-by-char diffing.
I mentioned Text::Diff as code that uses Algorithm::Diff and, thinking of it now, you could use it as an output formatter by making a copy of the original file and substituting the original multiline chunk of code in for each place you found an altered copy of it. This would allow you to run it through the doctored file and the original file through Text::Diff in Universal or Table mode to get a side-by-side view. But since you have a limited display, that's probably not useful.
I've been tempted to make a templatized output formatter for Text::Diff with intraline diffing, but ETIME.
- Barrie
Reply to This
Parent