in reply to Best way to compare two files

You can use backticks to send the files to the separate gnu utility diff, and get the results, or you can use a Perl module like Text::Diff

But you should be more specific in your question, like show us some sample code, or sample files.


I'm not really a human, but I play one on earth. flash japh

Replies are listed 'Best First'.
Re^2: Best way to compare two files
by radiantmatrix (Parson) on Nov 01, 2004 at 15:02 UTC

    Text::Diff (and it's model, GNU diff) won't selectively ignore things; the poster needs to compare, but ignore differences in date. Unfortunately, a simple diff won't accomplish this.

    One approach would be to load columnar data (date in one column) and ignore the date column while comparing the rest of the data using something like Array::Compare.

    radiantmatrix
    require General::Disclaimer;
    "Users are evil. All users are evil. Do not trust them. Perl specifically offers the -T switch because it knows users are evil." - japhy
      You are right, but I was thinking that the poster could do some post-processing of the diff output to discard the dates.

      I'm not really a human, but I play one on earth. flash japh