in reply to How to declare global variable in CGI file?
Do you want to have a central place (SPOT - Single Point of Truth) for certain variables seen by all your CGI scripts? Try putting things in a MySiteConf.pm module and having all scripts use MySiteConf.
In some cases, having environment variables (in the implicit %ENV hash) set appropriately can suffice. This is the case if you have the same script in various locations where it should behave differently based upon some changing circumstance. Look into checking %ENV in your perl and using SetEnv and SetEnvIf in your Apache setup.
It generally gets more complicated from there, with AppConfig and all the rest. Choose the simplest thing that fits your reasonably-anticipated needs (and is within your current level of comprehension).
|
|---|