Greeting.
Let's say I have a dozen or so proc's using many of the same variables from main. Is there any reason to prefer global variables over parameters (aka arguments) passed into the proc? Globals are certainly easier in some sense since I can define a list (gblst) of variable names in main, pass the list as a parameter and build a global command (set cmd "global"; foreach var $gblst {append cmd " $var}; eval $cmd) inside each proc. The question is, is there a performance or efficiency problem?
Let's say I have a dozen or so proc's using many of the same variables from main. Is there any reason to prefer global variables over parameters (aka arguments) passed into the proc? Globals are certainly easier in some sense since I can define a list (gblst) of variable names in main, pass the list as a parameter and build a global command (set cmd "global"; foreach var $gblst {append cmd " $var}; eval $cmd) inside each proc. The question is, is there a performance or efficiency problem?