Then the other various modules say stuff like: use SiteConfig qw($c); So what would need to happen is that SiteConfig would have to export a "$c" that is appropriate for the current request (based on some way to determine which of four domains it's serving). That doesn't even seem possible (to export something different at run-time when it's loaded when mod_perl starts). I think we'd have to change the interface from Exporter to a function or method call (in every one of our modules). There is also one "quick access" method inside SiteConfig.pm that allows you to grab any value w/out importing $c:package SiteConfig; use strict; use Exporter; our $c; @SiteConfig::ISA = qw(Exporter); @SiteConfig::EXPORT_OK = qw($c); $c->{dbname} = 'somedb'; $c->{dbserver} = 'somehost'; $c->{dbuser} = 'someuser'; $c->{dbpass} = 'somepass'; $c->{site_name} = 'Some Plain Text Name'; $c->{domain} = 'some-domain.com'; #... and a bunch more ...
That one seems like it would be easy to modify to return the appropriate value, if only I knew some reliable way to determine from which domain the request was coming.sub param { return $c->{(shift)}; }
In reply to Re^2: mod_perl and multiple installations of the same code
by saberworks
in thread mod_perl and multiple installations of the same code
by saberworks
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |