in reply to compare and find difference between two files

Verify using debugger or Data::Dumper that @a and @b contain what you think.

1 Peter 4:10
  • Comment on Re: compare and find difference between two files

Replies are listed 'Best First'.
Re^2: compare and find difference between two files
by myfrndjk (Sexton) on Jul 14, 2014 at 18:48 UTC
    Thanks for your reply .It works.
    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 = <F>; my $str1=<S>; 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";