Du machst die MD5-Summe über den Dateinamen.
Na, schon mal in die Doku geschaut ;)
QuoteThis is useful when calculating checksum for files:
use Digest::MD5;
my $file = shift || "/etc/passwd";
open(FILE, $file) or die "Can't open '$file': $!";
binmode(FILE);
$md5 = Digest::MD5->new;
while (<FILE>) {
$md5->add($_);
}
close(FILE);
print $md5->b64digest, " $file\n";
Or we can use the builtin addfile method for more efficient reading of the file:
use Digest::MD5;
my $file = shift || "/etc/passwd";
open(FILE, $file) or die "Can't open '$file': $!";
binmode(FILE);
print Digest::MD5->new->addfile(*FILE)->hexdigest, " $file\n";
\n\n
<!--EDIT|GwenDragon|1147360362-->