Hello fellow monks!
I am new to your site and I admit I have found many interesting and useful things about Perl here!
I want to do the following:
I have 2 files that may or may not have some different lines
(this I cannot know beforehand).
For example, you may have
FILE1 123 tomas kelly 345 678 ########### FILE2 123 nick kelly 459 678 OR FILE1 123 tomas kelly 345 678 ########### FILE2 123 tomas kelly 345 678
The good news is that the lines in file1 and file2 are equal, that is in line 1 of both files either you will find 123 or 123 (in one file) and something else in the other
What I want to do is read both files, and search to find if there is at least one difference.
I don't care if there are 10 or 100 differences between the 2 files, I just want to see if the files are identical line-by-line or they differ in one line at least.
I tried using diff but it did't work, so I was thinking if there is any quicker way...

In reply to quick and safe way to deal with this? by Anonymous Monk

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.