diff options
Diffstat (limited to 'perl-install/common.pm')
-rw-r--r-- | perl-install/common.pm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm index d05c1afd9..3ce56f91f 100644 --- a/perl-install/common.pm +++ b/perl-install/common.pm @@ -297,4 +297,18 @@ sub unpack_with_refs { @r; } +sub md5file { + require Digest::MD5; + my @md5 = map { + my $sum; + if (open(my $FILE, $_)) { + binmode($FILE); + $sum = Digest::MD5->new->addfile($FILE)->hexdigest; + close($FILE); + } + $sum; + } @_; + return wantarray() ? @md5 : $md5[0]; +} + 1; |