in reply to Capturing Results Of A System Command
use strict; use Digest::MD5 qw/md5_base64/; my $file = shift or die "No file specified on command-line.\n"; open IN, $file or die "Cannot open $file for input: $!\n"; my $digest = md5_base64(<IN>); close IN; print "Digest of $file is $digest\n";
Digest::MD5 has much stronger properties for guaranteeing that a given file has not been modified, and that two different files are indeed different, than the standard Unix checksum program.
|
|---|