comm comes to mind, but this is a perl forum, so here is a my shot at it, although it is flawed, as permutated lines do not get registered as a difference. Nor do extra repeated lines:

perl -ne '$lines++;$common++ if ($seen{$_} .= @ARGV) =~ /10$/; END{pri +ntf("%.2f",$common/$lines*200)}' file1.txt file2.txt

Not sure who to give credit to... here is the source: http://www.cyberciti.biz/faq/command-to-display-lines-common-in-files/
It extends to 3 files if you use "=~/210$/".
Another way would be parse the output of diff with perl. But Im not getting the correct syntax for that. Edit: Thanks! Here is my own spin:

perl -ne '$lines++;$common++ if ($seen{$_} .= @ARGV) eq "10"; END{prin +tf("%.2f",$common/$lines*200)}' file1.txt file2.txt


In reply to Re: Similarity measurement by FreeBeerReekingMonk
in thread Similarity measurement by kennedy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.