in reply to Re: file comparison using file open in binary mode.
in thread file comparison using file open in binary mode.
my %hash1; my %hash2; my $hash1Count=0; my $hash2Count=0; foreach my $FL (@remoteFilelist) { push @md51,md5sum($FL); $hash1{$FL} = md5sum($FL); $hash1Count++; } foreach my $FL2 (@return) { push @md52,md5sum($logSite.$FL2); $hash2{$logSite.$FL2} = md5sum($logSite.$FL2); $hash2Count++; } if ($hash1Count >= $hash2Count) { foreach my $key ( keys %hash1 ) { if (!exists($hash2{$key})) { my $temp = $hash2{$key}; push (@finalCompareArray, $temp); } } }else{ foreach my $key ( keys %hash2 ) { if (!exists($hash1{$key})) { my $temp = $hash1{$key}; push (@finalCompareArray, $temp); } } }
|
|---|