/usr/share/perl5/IO/Digest.pm is in libio-digest-perl 0.11-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | package IO::Digest;
use 5.008;
use strict;
use warnings;
use PerlIO::via::dynamic '0.10';
our $VERSION = '0.11';
=head1 NAME
IO::Digest - Calculate digests while reading or writing
=head1 SYNOPSIS
use IO::Digest;
# Get a Digest::MD5 object that takes input while $fh being written or read
my $fh;
my $iod = IO::Digest->new ($fh, 'MD5');
print $fh "fooo";
print $iod->hexdigest
=head1 DESCRIPTION
This module allows you to calculate digests while reading or writing
file handles. This avoids the case you need to reread the same
content to compute the digests after written a file.
=cut
use Digest ();
sub new {
my $class = shift;
my $fh = shift;
my $digest = Digest->new (@_);
my $add = sub { $digest->add($_[1]) };
my %map = (translate => $add, untranslate => $add);
PerlIO::via::dynamic->new ( use_read => 1, %map )->via ($fh);
return $digest;
}
=head1 TEST COVERAGE
----------------------------------- ------ ------ ------ ------ ------ ------
File stmt branch cond sub time total
----------------------------------- ------ ------ ------ ------ ------ ------
blib/lib/IO/Digest.pm 100.0 n/a n/a 100.0 100.0 100.0
Total 100.0 n/a n/a 100.0 100.0 100.0
----------------------------------- ------ ------ ------ ------ ------ ------
=head1 AUTHORS
Chia-liang Kao E<lt>clkao@clkao.orgE<gt>
=head1 COPYRIGHT
Copyright 2004 by Chia-liang Kao E<lt>clkao@clkao.orgE<gt>.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
See L<http://www.perl.com/perl/misc/Artistic.html>
=cut
1;
|