Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pass in an array that has array of the file name
- #go through the array and make the name of the file have a md5
- #make hash that have the file name as the key and md5 is the value
- #add in the hash for the dir and the timestamp
- #return of the hash
- my @listName = @_; # this is the file name
- my %hash;
- my $MD5 = Digest::MD5->new;
- my @listMD5; #pass in an array that has array of the file name
- #go through the array and make the name of the file have a md5
- #make hash that have the file name as the key and md5 is the value
- #add in the hash for the dir and the timestamp
- #return of the hash
- my @listName = @_; # this is the file name
- my %hash;
- my $MD5 = Digest::MD5->new;
- my @listMD5;
- foreach my $name (@listName)
- {
- #get the md5 for each files
- open(FILEIN, $name);
- binmode(FILEIN);
- push(@listMD5, $MD5->addfile(*FILEIN)->hexdigest);
- close (FILEIN);
- }
- foreach my $name (@listName)
- {
- #get the md5 for each files
- open(FILEIN, $name);
- binmode(FILEIN);
- push(@listMD5, $MD5->addfile(*FILEIN)->hexdigest);
- close (FILEIN);
- }
Advertisement
Add Comment
Please, Sign In to add comment