Believe me when I say I really trust you, but I think it would be a lot more satisfying for all concerned if you could post some sample data, a code snippet, and the results of an actual run of that code on that data to demonstrate the problem.
I looked at the source code for File::Compare (you can do that too), and it seems both cleverly done and reasonably solid. So I'm inclined to say you need to prove your assertion that it says two files are the same even when they are not. For example, I proved (to a small degree) that the module works as advertised, with this sequence of five shell commands:
The return value "0" means the files are the same (which was true in the first run) and "1" means they are different (which was true in the second run). Can you provide a counter-example?$ echo blah > /tmp/j1 $ echo blah > /tmp/j2 $ perl -MFile::Compare -le '$r=compare("/tmp/j1","/tmp/j2"); print $r' 0 $ echo blag > /tmp/j2 $ perl -MFile::Compare -le '$r=compare("/tmp/j1","/tmp/j2"); print $r' 1
UPDATE: In case the problem only appears with some pair of really big files, you could also try pointing out the sizes and MD5 signatures of the two files (see Digest::MD5, or just use the gnu "md5sum" tool). Obviously, files of different sizes cannot be the same (and File::Compare checks that first), and two files of the same size but with different checksums also cannot be the same.
Identical size and checksum is not a guarantee of identical content, but at least you only have to do a full content comparison on file pairs that match on those two factors (and computing/comparing checksums is cheaper than doing comparisons of all file data).
In reply to Re: File::Compare::compare() problem
by graff
in thread File::Compare::compare() problem
by cascadekee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |