in reply to Exporting Variables
I think the most commonly accepted way to do this is probably to use an actual configuration file and use JSON, YAML, or Windows-style INI file modules to read the settings. The second most common way I think is to use an actual Perl module that contains the settings. Instead of using Exporter, you could use the values from the specified namespace or as an object.
Whichever method you choose for the configuration file, you can instantiate a configuration object that has all the settings as object data accessible through getter methods. If that doesn't work for you, you should still not make the variables global. You can access variables that are in a module's namespace by prepending the name of the module. Well, actually it's a package namespace but often enough the two are the same scope. See perlmod for more information about modules and scope issues with them.
|
|---|