in reply to Calc md5 for file by drag and drop (Windows)
Nice! But...
use Digest::MD5::File qw(file_md5);
Ok, but then you're using Digest::MD5 instead, which indeed is loaded by Digest::MD5::File. You may just either use the former since it's a core module now or take advantage of the latter:
my $myfile = shift; my $md5 = new Digest::MD5; $md5->addpath($myfile); my $digest = $md5->hexdigest; Win32::Clipboard::Set ($digest);
I would just either
Win32::Clipboard::Set Digest::MD5->new->addpath(shift)->hexdigest;
or
Win32::Clipboard::Set file_md5 shift;
in the two respective cases hinted above.
Oh, and I wouldn't print $digest; since we're putting that info in the clipboard anyway, but I would use wperl.exe instead. Of course an alternative would be a minimal GUI (e.g. Tk) showing the computed checksum, possibly along with a button to copy to the clipboard or compare with a value previously stored into it. However this would loose the fascinating simplicity/minimality of your solution...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Calc md5 for file by drag and drop (Windows)
by GrandFather (Saint) on Oct 18, 2005 at 20:04 UTC |