-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.pl
More file actions
34 lines (29 loc) · 708 Bytes
/
test.pl
File metadata and controls
34 lines (29 loc) · 708 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# use File::Find;
# my $directory = "./subfolder";
# opendir (DIR, $directory) or die $!;
# find(\&getFile, $directory);
# sub getFile {
# if (-d){
# }else{
# print $File::Find::name, "\n";
# }
# }
# my $dir = "./subfolder";
# opendir DIR,$dir;
# my @dir = readdir(DIR);
# close DIR;
# foreach(@dir){
# if (-f $dir . "/" . $_ ){
# print $_," : file\n";
# }elsif(-d $dir . "/" . $_){
# print $_," : folder\n";
# }else{
# print $_," : other\n";
# }
# }
use strict;
use warnings;
use File::Find;
use Digest::MD5 qw(md5 md5_hex md5_base64);
use Digest::file qw(digest_file_hex);
print digest_file_hex('./subfolder/file3.txt', "MD5"),"\n" ;