in reply to Caching File-based Config across many sessions

if you put your config-data in a hashtable there's an easy way for you:

package MyApp::Config; use strict; use vars qw/%appdata/; %appdata = ( key_1 => value_1, [...] key_n => value_n );
startup.pl:
use MyApp::Config;
later in your cgi-scripts:
our %appdata; *appdata = \%MyApp::Config::appdata;


-----------------------------------
masses are the opiate for religion.

Replies are listed 'Best First'.
Re^2: Caching File-based Config across many sessions
by mpeters (Chaplain) on May 01, 2007 at 01:13 UTC

    This won't work right in mod_perl by itself since changes to the config package will require a restart of the server which the OP said he didn't want.

    What will work is doing the above with Apache::Reload. And to reduce the impact of Apache::Reload on the rest of your modules you can restrict it to just check this one config package.


    -- More people are killed every year by pigs than by sharks, which shows you how good we are at evaluating risk. -- Bruce Schneier