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
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).Tied variables allow you to have things that appear to be variables but are in fact subroutines.
package SiteConfig; use strict; use base 'Exporter'; tie our $c, 'SiteConfig'; our @EXPORT_OK = qw($c); sub FETCH {{ dbname => 'somedb', dbserver => 'somehost', dbuser => 'someuser', dbpass => 'somepass', site_name => 'Some Plain Text Name', domain => 'some-domain.com', #... and a bunch more ... }}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: mod_perl and multiple installations of the same code
by saberworks (Curate) on Mar 17, 2005 at 18:10 UTC |