Find changes or differences in 2 text files

B

Bill H

Is there a simple perlish way (or module) of comparing 2 text files
(or 2 strings containing their contents) and determining what is
different between the two? These text files are straight text, not
data of any type. Something along the lines of Diff without having to
shell out to it (unless Difff is faster).

Bill H
 
L

Leon Timmermans

Is there a simple perlish way (or module) of comparing 2 text files (or
2 strings containing their contents) and determining what is different
between the two? These text files are straight text, not data of any
type. Something along the lines of Diff without having to shell out to
it (unless Difff is faster).

Bill H

Please try CPAN before asking these kinds of questions. If you did, you
would have found Text::Diff, which does exactly what you are asking for.

Regards,

Leon Timmermans
 
B

Bill H

Please try CPAN before asking these kinds of questions. If you did, you
would have found Text::Diff, which does exactly what you are asking for.

Regards,

Leon Timmermans

Leon

Thanks for the tip - FYI searching for any variation of:

Find changes or differences in 2 text files

Finds nothing on Cpan. The search engine on there is very limited. I
would need to know what I am looking for to find what I am looking
for. And if I search for Diff, I get 124 different modules to dig
through.

Bill H
 
T

Tad J McClellan

^^^^^^^^^
^^^^^^^^^

Are you coding a high-performance application or expect hundred-Mb
strings to compare or something?

"Premature optimization is the root of all evil". (Google it)

First you want an approach that does what you want it to do.

Only if the 1st approach proves to be too slow should you
concern yourself with execution speed.



This is some very sage advice. Please don't dismiss it...

Thanks for the tip - FYI searching for any variation of:

Find changes or differences in 2 text files

Finds nothing on Cpan. The search engine on there is very limited.


It is a keyword search, not a natural language processing search.

You need to give it a keyword.

Like "Diff", which you already knew was a relevant keyword.

I
would need to know what I am looking for to find what I am looking
for.


You did know what you were looking for, you were looking for
something along the lines of "Diff", so I fail to see the
relevance of the quote snippet above.

And if I search for Diff, I get 124 different modules to dig
through.


FYI, posting here rather than first taking the 5 minutes necessary
to dig through CPAN results can severely damage your ability to get
help with future Perl questions.
 

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

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top