How would I go about (either via tie or straight object instantiation) creating a BerekelyDB::Hash variable during
PerlChildInitHandler, and then access it during
PerlTransHandler?
To Wit, my latest attempt:
in httpd.conf
PerlSetVar streamDB "/adconfig/config"
PerlSetVar clickDB "/adconfig/click"
PerlChildInitHandler Config
PerlTransHandler Serve
in Config.pm
sub handler
{
my $r=shift;
my $config=$r->dir_config('streamDB');
my $click=$r->dir_config('clickDB');
%CORE::GLOBAL::config = new BerkeleyDB::Hash
-Filename => $config,
-Flags => "DB_RDONLY"
or die "Cannot open file $config: $!$BerkleleyDB::Error\n";
}
In Serve.pm
sub handler
{
my $r=shift;
unless (scalar(keys %CORE::GLOBAL::config))
{
die ("no config data loaded");
}
# Code Always dies
}
I've got the requisite use statments and such in Config.pm, and have tried tied hashes, stashing hashrefs in
pnotes and untied hashes, and am now at the end of my rope.
Any thoughts?
ÅßÅ×ÅßÅ
"It is a very mixed blessing to be brought back from the dead." -- Kurt Vonnegut
|