go ahead... be a heretic | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
The addfile($fh) tells Digest::SHA or Digest::MD5 to read from a filehandle. Once the handle has been read from in its entirety, it is "spent" or exhausted (it's at the end of the file). Subsequent reads aren't going to be successful unless you re-open the file, or rewind to the beginning with seek. Imagine this code:
That final read will be unsuccessful, because the while loop already exhausted the handle. The same behavior exists when you pass a handle to some other routine that exhausts it, which is what Digest::SHA is doing. Dave In reply to Re: Digest::MD5 and SHA addfile appear to be clearing the buffer
by davido
|
|