in reply to Re^2: mod_perl and multiple installations of the same code
in thread mod_perl and multiple installations of the same code

Running under mod_perl, you should be able to get an Apache::Request object easily, using something like this:
# $c = { 'foo.com' => { dbname => 'foo', dbuser => 'foo', }, 'bar.com' => { dbname => 'bar', dbuser => 'bar', } }; sub param { my $param = shift; # get a request instance my $r = Apache::Request->instance(); # get the hostname my $host = $r->hostname(); return $c->{$host}->{$param}; }
This obviously doesn't take into account 'www.foo.com' and 'foo.com' if they're the same thing, but a little munging of $host before using it, should allow you to find the right one, or worst case, fall back to a default.