in reply to Digest::MD5 and SHA addfile appear to be clearing the buffer

Instead of using the filehandle, you could just pass the filename to the addfile() method (such as print "SHA224: ", $sha224->addfile($file, "b")->hexdigest, "\n";), which would let the module handle the details.

Hope that helps.

Replies are listed 'Best First'.
Re^2: Digest::MD5 and SHA addfile appear to be clearing the buffer
by dt667 (Acolyte) on Jun 11, 2014 at 11:05 UTC

    I just assumed the MD5 and SHA modules took the same parameters, but it appears the MD5 module requires a filehandle where as the SHA module takes either a filehandle or filename. Thanks!