http://www.perlmonks.org?node_id=1016585
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks!
I am trying to compare two text files with a bunch of links in each line, I would like to know what is not on the second file that is on the second file. Print the difference between the two files. I am using this code but It doesn't make sense on the results Iím getting, ma someone has a better way of doing this. Here is the code I am using:
a_file.txt sample: http://www.ok.com/test_www.pdf http://www.ok.com/test_1234.html http://www.ok.com/test_part.pdf http://www.ok.com/test_345.pdf http://www.ok.com/test_error.html
b_file.txt sample: http://www.ok.com/test_www.pdf http://www.ok.com/test_part.pdf http://www.ok.com/test_345.pdf
#!/usr/bin/perl use strict; use warnings; use Text::Diff; my $diffs = diff 'a_file.txt' => 'b_file.txt'; print $diffs;