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

Thanks look's like the MD5 works nicely. one last question, how do i do the comparioson with each value in the hash? This is what i go thus far, but doesn't seem to work.
while ( my ($key, $value) = each(%hash1) ) { while ( my ($key1, $value1) = each(%hash2) ) { if ($value eq $value1) { print "\n$key => $value\n is equal with\n"; print "$key1 => $value1\n" } } print "$key => $value\n"; }

Replies are listed 'Best First'.
Re^5: file comparison using file open in binary mode.
by zwon (Abbot) on Nov 27, 2009 at 20:35 UTC

    It'll be funnier if you would use hash values as keys and file names as values. Then in order to find if there's same file in another tree you could use something like:

    for (keys %hash1) { if (exists $hash2{$_}) { say "Files $hash1{$_} and $hash2{$_} are equal"; } }
    (Not tested)