in reply to Re^2: Common subs and Global Variables
in thread Common subs and Global Variables
Encapsulation, the same reason we use my variables.
Limiting the scope of variables has a number of benefits. Primarily, that name clashes less likely, and that it's easier to find users of the variable. Don't underestimate the value of the latter; it's huge. Conversely, using variables as part of the module's interface creates a very rigid interface.
|
|---|