require Encode; use Digest::MD5 qw(md5 md5_hex md5_base64); my $ctx = Digest::MD5->new;; my $where = "C:/0work/test"; open O, ">:utf8", "C:\\0work\\test\\out.txt" or die "Couldn't open STDOUT: $!" || die "can't open\n"; opendir (D, $where) or print " \ncould not open the directory: $!"; binmode D, ":utf8"; binmode O, ":utf8"; print O "reading the list from the directory $where\n"; my @list = readdir (D); for my $file (sort @list){ next if ! -f $file; print O "$file\n"; open(I,"<$file") || die "couldbn't open $file"; binmode(I, ":utf8"); $ctx->addfile(I); my $digest = $ctx->b64digest; print "digest:", $digest; } #### use strict; use warnings; use Cwd; use File::Find; use Digest::MD5 qw(md5 md5_hex md5_base64); use File::Basename; require Encode; $|++; my $ctx = Digest::MD5->new; my $totcnt=0; find (&d, "C:/0work/pics/Done"); binmode STDOUT, ":utf8"; sub d { my $file = $File::Find::name; print $file, "\n"; return unless -f $file; open(I,$file); binmode(I); $ctx->addfile(*I); my $digest = $ctx->b64digest; print $file, $digest, "\n"; close(I); }