in reply to Re: file comparison using file open in binary mode.
in thread file comparison using file open in binary mode.

JohnGG, thanks for the idea. However, this is just on a file per file base as the file could have been renamed but the size is the same. This is just a small application, not it won't be doing a mass amount of files. This is what i have come up with thus far. I build the hash's which works great. But I am still stumped on the compare. So first I tried to figure out which hash is bigger to use as the foreach loop so it will go though all the files. However, this is still not working. There must be an easy way that I am missing to compare two hashs (specifically the values) and add the difference to another hash/array that I could use.
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); } } }