in reply to Using diff in perl
I've looked at your post a few times with a bit of confusion. I am not entirely sure what you are trying to do, maybe an example or two would help?
As for the 2 modules, Text::Diff inherits Algorithm::Diff so that might be the best route to go. Although it is slower than the GNU Diff (with large files) which depending on if your system has it or not it might be best to shell it out.
Re^2: Using diff in perl
by tsk1979 (Scribe) on Apr 05, 2006 at 07:39 UTC
|
My script will work on the results of running a testcase
The testcase run creates a few data file. We compare the data files with the data.gold files which have been created.
So all this script will do it will do a diff between the data file created and the data.gold file. It will ignore lines like "Testcase ran on server x" etc., or WARNING, logs will be created in directory y.
this way we diff only the relevent data while ignoreing a preset data.
Earlier we had one data file to be compared with data.gold file
So all I did was a diff data.gold data --ignore-matching-lines="regexp".
Now I will compare multiple files and make a composite DIFF file containing the differences. | [reply] |
|
I'm wondering if you shouldn't try using a plain diff tool, and postprocess the result with Perl. I personally find the output of diff -u very easy to parse.
| [reply] [d/l] |
|
thanks, I am going to use GNU diff and then post process the results. this will be simpler and faster
| [reply] |
|