| Next | Program Repair Shop | 50 |
Here's the relevant part of compare_by_md5_sum():
604 sub compare_by_md5_sum
605 {
...
push @md5_LoL , \@files;
...
654 }
It's easy to fix this:
sub compare_by_md5_sum
{
my @md5_LoL;
...
push @md5_LoL , \@files;
...
return @md5_LoL;
}
Then the caller should replace this:
425 for $array_ref (@name_list)
426 {
427 compare_by_md5_sum (@$array_ref); # results in @md5_LoL
428 }
With this:
425 for $array_ref (@name_list)
426 {
push @md5_LoL, compare_by_md5_sum (@$array_ref);
428 }
Cost: 2 lines
Benefit: Modular functions and one fewer comment
| Next | ![]() |
Copyright © 2006 M. J. Dominus |