【发布时间】:2015-03-19 17:29:08
【问题描述】:
如何在 if 语句中使用 perl 中的 md5sum 检查重复文件?
我正在寻找这样的代码行:
if { (md5 of new file matches any of the md5sum values of already parsed files)
print "duplicate found"
} else { new file and add md5sum to a list for check)
print "new file"
}
【问题讨论】:
-
你应该看看
Digest::MD5。它显示了如何计算文件的哈希和的示例。