http://www.perlmonks.org?node_id=996290


in reply to Naming Convention For Global Variables?

Whatever works for you is OK. And if you document it and abide by your own rules, then it should be OK for any future maintenance programmer looking after your code.

Personally I limit the use of all uppercase (lexical) variable-names to filehandles.

I try not to have really global variables. Any data should go in and out of modules, objects, subroutines, functions, ... only through parameters and return values and never through global variables. The scope of my variables is limited as much as possible.

I only have one exception and that are global configuration parameters, which are always inside the %config hash and are only accessed through this hash.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics