use Data::Dumper qw(Dumper); use strict; use warnings; use List::Compare; open F,"<","C:/Users/jeyakuma/Desktop/file1.txt" ; open S, "<","C:/Users/jeyakuma/Desktop/file.txt" ; my $str = ; my $str1=; my @old = split / /, $str; my @new=split / /, $str1; my $lc = List::Compare->new(\@old,\@new); my @intersection = $lc->get_intersection; my @firstonly = $lc->get_unique; my @secondonly = $lc->get_complement; print "Present only in old dump data@firstonly\n"; print "Present only in new data @secondonly\n";