How about looping through each file. Comparing it with ones after it in the array. You can even load ones that were previously compared, so you get a structure containing what you want.
Example:
use strict;
use Data::Dumper;
use File::Compare;
my @files = qw( file0 file1 file2 );
my @results;
foreach my $i (0..$#files){
$results[$i] = [];
#Already compared these
foreach my $j(0..($i-1)){
$results[$i][$j] = $results[$j][$i];
}
#Same File
$results[$i][$i] = 1;
#New Comparisons
foreach my $j(($i+1)..$#files){
$results[$i][$j] = compare($files[$i],$files[$j]);
}
}
print Dumper \@results;
So $results[0][1] is the result of a comparison between files file0 and file1, and $results[0][2] is the result of a comparison between files file0 and file2. |