addfile#
Append everything that can be read from a filehandle to the message.
The handle is read to its end as it is, bytes as they come, so a text file should be opened with binmode to hash its exact contents. Dies “No filehandle passed” for a handle that is not open for reading and “Reading from filehandle failed” when a read fails. Returns the object.
Synopsis#
open my $fh, '<:raw', $file or die "$file: $!";
print Digest::SHA1->new->addfile($fh)->hexdigest, " $file\n";