App-cloc
view release on metacpan or search on metacpan
print "-> different_files(@{$ra_files})\n" if $opt_v > 2;
my %file_hash = (); # file_hash{md5 hash} = [ file1, file2, ... ]
foreach my $F (@{$ra_files}) {
next if is_dir($F); # needed for Windows
my $IN = new IO::File $F, "r";
if (!defined $IN) {
push @{$raa_errors}, [$rh_Err->{'Unable to read'} , $F];
$rh_ignored->{$F} = 'cannot read';
} else {
if ($HAVE_Digest_MD5) {
binmode $IN;
my $MD5 = Digest::MD5->new->addfile($IN)->hexdigest;
#print "$F, $MD5\n";
push @{$file_hash{$MD5}}, $F;
} else {
# all files treated unique
push @{$file_hash{$F}}, $F;
}
$IN->close;
}
}
( run in 1.263 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )