SHOW:
|
|
- or go back to the newest paste.
| 1 | - | print "hello world\n"; |
| 1 | + | #pass in an array that has array of the file name |
| 2 | #go through the array and make the name of the file have a md5 | |
| 3 | #make hash that have the file name as the key and md5 is the value | |
| 4 | #add in the hash for the dir and the timestamp | |
| 5 | #return of the hash | |
| 6 | ||
| 7 | my @listName = @_; # this is the file name | |
| 8 | my %hash; | |
| 9 | my $MD5 = Digest::MD5->new; | |
| 10 | my @listMD5; #pass in an array that has array of the file name | |
| 11 | #go through the array and make the name of the file have a md5 | |
| 12 | #make hash that have the file name as the key and md5 is the value | |
| 13 | #add in the hash for the dir and the timestamp | |
| 14 | #return of the hash | |
| 15 | my @listName = @_; # this is the file name | |
| 16 | my %hash; | |
| 17 | my $MD5 = Digest::MD5->new; | |
| 18 | my @listMD5; | |
| 19 | ||
| 20 | foreach my $name (@listName) | |
| 21 | {
| |
| 22 | #get the md5 for each files | |
| 23 | open(FILEIN, $name); | |
| 24 | binmode(FILEIN); | |
| 25 | push(@listMD5, $MD5->addfile(*FILEIN)->hexdigest); | |
| 26 | close (FILEIN); | |
| 27 | } | |
| 28 | ||
| 29 | foreach my $name (@listName) | |
| 30 | {
| |
| 31 | #get the md5 for each files | |
| 32 | open(FILEIN, $name); | |
| 33 | binmode(FILEIN); | |
| 34 | push(@listMD5, $MD5->addfile(*FILEIN)->hexdigest); | |
| 35 | close (FILEIN); | |
| 36 | } |