Next | Program Repair Shop | 49 |
The big loop has:
427 compare_by_md5_sum (@$array_ref); # results in @md5_LoL
445 compare_by_fc (@$array_ref); # results in @fc_LoL
Functions should avoid using global variables
Why do we have functions?
For modularity
Benefit 1: Understand the function in isolation
Benefit 2: Reuse the function in another program
Using global variables in functions defeats both of these
Use functional parameter-passing mechanisms wherever possible
Global Variables are red flags
Next | ![]() |
Copyright © 2006 M. J. Dominus |