#!/usr/bin/env perl use strict; use warnings; use Path::Tiny; use Algorithm::Diff qw/diff/; my @lines1 = path('GoodFile.txt')->lines; my @lines2 = path('BadFile.txt')->lines; my $diff = Algorithm::Diff->new( \@lines1, \@lines2 ); while( $diff->Next() ){ next if $diff->Same(); print $diff->Items(2), "\n"; } exit; #### This section is the description of the animal bla bla lbas.....bla bla lbas..... Amimal, cat, 3, 4, YELLOW LEG 3, HIGH 'this is a cattt 1 This section is the description of the animal bla bla lbas.....bla bla lbas blaaaal........ #### Amimal, cat, 1, 4, YELLOW HAIR 3, HIGH 'this is a cattt 1 This section is the description of the animal bla bla lbas..... Amimal, dog, 2, 4, BLACK HEAD 1, HIGHf'this is a doggg 2 This section is the description of the animal bla bla lbas..... #### Amimal, cat, 1, 4, YELLOW HAIR 3, HIGH 'this is a cattt 1 This section is the description of the animal bla bla lbas.....bla bla lbas..... Amimal, cat, 3, 4, YELLOW LEG 3, HIGH 'this is a cattt 1 This section is the description of the animal bla bla lbas.....bla bla lbas blaaaal........