in reply to File Compare
1. see File::Compare - Compare files or filehandles
2. Or you can try something like,my %data_hash; open(my $fh, '<', "datafile.txt") or die $!; while(<$fh>){ $data_hash{$_} = 1; } close($fh); open(my $fh1, '<', "tmpfile.txt") or die $!; while(<fh1>){ if(defined($data_hash{$_})){ print"Line match"; }else{ print"Line not match"; } } close($fh2); close($fh1);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: File Compare
by Cicatrix (Novice) on Mar 23, 2011 at 06:51 UTC |