Next | Program Repair Shop | 51 |
Since we're on the subject...
Purely cosmetic changes can make this function significantly easier to read
607 my ($md5sum); 609 my ($md5) = Digest::MD5->new; 628 $md5->reset(); 629 $md5->addfile(MD5_fd); 631 $md5sum = $md5->digest();
The MD5 module is expressly designed so that you can reduce this to:
my $md5sum = Digest::MD5->new->add_file(MD5_fd)->digest;
4 lines of code and one variable are gone
Next | ![]() |
Copyright © 2006 M. J. Dominus |