-
be able to load shared config info that is machine-specific but relevant across many apps (e.g., directory prefixes, current environment (dev, prod), current server name, etc.). Would like to be able to pass in a project name to allow some automatic customization of directory paths
For this, why not create config object, similar to what you are already doing. However, instead of trying to pass the project name in during the use My::LocalConfig qw(project_name);, do something like this:
use My::LocalConfig;
my $local_config = new My::LocalConfig '<project>';
Then, within your
new method, you can customize some of the directory paths.
be able to load app-specific info, and use variables from the shared info to do it (e.g., use a path from the shared info to tell me where to find my app-specific config file on a given system)
Following along the same path as before, we can now use an object to clarify app-specific info. Since information from the machine config is necessary, it can again be passed into the new method of your app-specific config object.
require "$local_config->{CONFIG_PATH}/AppConfig.pm";
my $app_config = new AppConfig $local_config;
load 'session scoped' info appropriately with a layer of abstraction so apps aren't directly using $ENV{REMOTE_USER}; I want a layer because depending on the auth system we use, the current username might be in REMOTE_USER or SOME_OTHER_ENV and I'd like to abstract that from direct use by apps
For session information I would suggest using a module such as CGI::Session or Apache::Session. I have used CGI::Session before and found it quite nice, but never under a mod_perl environment. The documentation for CGI::Session did not mention anything about mod_perl, but the documentation for Apache::Session says the following: "Apache::Session is designed to work with Apache and mod_perl, but it should work under CGI and other web servers, and it also works outside of a web server altogether."
I hope this helps in your search for configuration options.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.