Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Using diff in perl

by zer (Deacon)
on Apr 05, 2006 at 06:55 UTC ( [id://541293]=note: print w/replies, xml ) Need Help??


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.

Replies are listed 'Best First'.
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.
      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.
        thanks, I am going to use GNU diff and then post process the results. this will be simpler and faster

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://541293]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-04-19 14:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found