in reply to Comparing the contents of two files

Your example shows differences on a single line, but your question asks about differences in a file. These will require different solutions, but maybe you are looking for a solution that handles both.

Like another has suggested, I would look at POSIX's comm, and then perhaps run the results from that through String::Diff.

  • Comment on Re: Comparing the contents of two files