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

That is not the case. Only the content matters.

gmargo@tesla 1368$ ls -l perl10.pl -rw-r--r-- 1 gmargo gmargo 1150 Oct 16 21:43 perl10.pl gmargo@tesla 1369$ cp perl10.pl perl10a.pl gmargo@tesla 1370$ md5sum -b perl10.pl perl10a.pl 976ed3393d1e967b2d8b4432c92b1397 *perl10.pl 976ed3393d1e967b2d8b4432c92b1397 *perl10a.pl gmargo@tesla 1371$ sha1sum -b perl10.pl perl10a.pl 1f62d2bcc8dcdf3f9ef0f3728f9f99c85eb21d81 *perl10.pl 1f62d2bcc8dcdf3f9ef0f3728f9f99c85eb21d81 *perl10a.pl

Replies are listed 'Best First'.
Re^4: file comparison using file open in binary mode.
by Karger78 (Beadle) on Nov 27, 2009 at 18:19 UTC
    ok, let me give md5 a shot again. perhaps i did somthing wrong.
Re^4: file comparison using file open in binary mode.
by Karger78 (Beadle) on Nov 27, 2009 at 20:06 UTC
    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"; }

      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)