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; }