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.
Subantive content of Perl programs (Score:2)
A random idea: measuring the degree of redundancy in a Perl source file. I think it'd have to be something other that just simple text redundancy, since you dan't want short symbol names (or hash key) being favored over long ones.
Re:Subantive content of Perl programs (Score:1)
Of course the statistic needs to be weighted by the number of lines and length of the lines.
What is debatable is whether one should toss single-line idioms such as
@out = sort {$a $b} @list;
which might occur in several places, into a single subroutine.
Re:Subantive content of Perl programs (Score:2)
I think a feature to detect the longest sequence of repeated lines would be useful, too.
J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
Visualizing it (Score:1)
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 diff