Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Naming Convention For Global Variables?

by CountZero (Bishop)
on Sep 28, 2012 at 20:42 UTC ( #996290=note: print w/ replies, xml ) Need Help??

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.


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

Comment on Re: Naming Convention For Global Variables?
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://996290]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2015-11-26 11:48 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (697 votes), past polls