On Wed May 14 11:09:24 2014, CHORNY wrote:
Show quoted text> This code (from test of IO::Callback) no longer works
>
> use IO::Callback;
>
> my $block = "foo\n" x 1000;
> my $lines = 0;
> my $fh = IO::Callback->new('<', sub {
> return if $lines++ >= 1000;
> return $block;
> });
>
> my $digest = Digest::SHA->new(256)->addfile($fh)->hexdigest;
>
>
Thanks for bringing this to my notice.
The solution is to use the pre-5.89 implementation of 'addfile' (taken from Digest::base) for already-opened file handles.
Fortunately the modification won't interfere with the new, much-faster 'addfilebin' which will still be used for files passed in by name.
The next release (5.91, TBS) of Digest::SHA and Digest::SHA3 will resolve this ticket.
Mark