Re: Singleton Persistence

Perrin Harkins <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <CAC0_be1rt3yjc51x41s8yHx9ULHdV1kxxTckHc5er5b2daNNYQ@mail.gmail.com>
On Mon, Feb 3, 2014 at 5:33 PM, Chris Bennett
<[email protected]> wrote:
> Right now I am using pg_1_.pl and pg_2.pl on the different hosts, but
> the code is identical, except that some data is pulled in from a config
> file for the different databases, etc used.
>
> Can I safely use pg.pl on both VirtualHosts or do I need to do something
> else also to do this?

I'm sure that you can use the same code, but the question is how do
you know which data to pull in and how do you store it in perl data
structures?  One common approach in this situation is to use
PerlSetVar inside your virtualhost config to set something you can
read from perl that will tell you which virtualhost you're in.  Then
you can use that as a key into a data structure or for triggering
conditional behavior.

- Perrin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.