diff in Perl

M

Market Mutant

I need to compare to docs and output something similar to diff in unix.

I got two files. Both are in CSV table format. 1 is sitting on my HardDrive,
the other has to be downloaded from the inet. I need to be alerted if there
is difference, and I should also save both copies for eyes to view.
 
A

Anno Siegel

Market Mutant said:
I need to compare to docs and output something similar to diff in unix.

I got two files. Both are in CSV table format. 1 is sitting on my HardDrive,
the other has to be downloaded from the inet. I need to be alerted if there
is difference, and I should also save both copies for eyes to view.

If all you want is an alert if the files are different, you can just
compare them line-wise and bail out at the first difference.

If you need more, don't try to roll your own -- diff algorithms are
more than tricky. There are a few modules on CPAN that match "Diff"
and look promising, or you can shell out to the Unix diff.

Anno
 
D

David K. Wall

If all you want is an alert if the files are different, you can just
compare them line-wise and bail out at the first difference.

If you need more, don't try to roll your own -- diff algorithms are
more than tricky. There are a few modules on CPAN that match "Diff"
and look promising, or you can shell out to the Unix diff.

There is a Perl Power Tools version of diff at
http://www.perl.com/language/ppt/src/diff/index.html

A web search for GNU tools win32 will turn up several versions compiled to
native win32 binaries, and there's always the Cygwin tools.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top