I am using the diff command as follows
use Text::Diff; my $diff = diff "C:/after.txt", "C:/before.txt", { OUTPUT => \*DIFFILE +, STYLE => "Table" };

and I get the following in the file pointed to by DIFFILE:

+--+----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
| |C:/before.txt |C:/after.txt |
| |Thu Dec 22 12:00:23 2011 |Thu Dec 22 12:01:12 2011 |
+--+----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
* 1|MONA|Female|20610|Mother-In-Law |MONA|Female|20610|Lord Godess of the Universe * |
2|SAM|Male|13122|Doctor |SAM|Male|13122|Doctor | |
3|BOB|Male|11623|Accountant |BOB|Male|11623|Accountant |
+--+----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
The first line is definitely different between the files and should appear in the 'diff' table. But...
Question: Why do I get the next 2 lines back when they are identical?
These files that are being compared have exactly 1000 lines of which only the first line is visibly different. So the first line is the only one that should come back in the diff table.
Using Perl 5.14.2 on Win32
Cheers!

In reply to diff not working as it should by tale051258

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.