Phil Carmody wrote:

The problem I'm having is that the package namespaces for the two handlers, and 
every module they require, clash. I might need different @INCs too. How have 
people got around this problem in the past?

It's not a mod_perl problem. This is just how Perl works. You can't have 2 packages with the same name. Period. Sometimes it's easy to think that Apache's VHosts are using different Perl interpreters, but they aren't. Within the same process it's all the same interpreter.

So, if you want something similar to your original goal I see the following 
options:

1) Use a separate Apache. This isn't as hard as it sounds. And if you already have a proxy in front (which you should) it's even easier. Just have some mod_redirect rules which send requests for your dev version to a different port and have your other dev apache listening on that port. You don't even need another machine.

2) Rename your dev module to something like Dev::OriginalModuleName. You could have some automated scripts that process your dev code to remove these before sending it to production.

I like #1. I use it all the time for things like this and it works great. Complete separation between the code. Since each Apache has a different @INC you can also do things like testing out upgraded versions of CPAN modules, etc. I personally wouldn't do #2 since it means that the code you test out isn't exactly the same code that you push to production. That would bother me.

--
Michael Peters
Plus Three, LP

Reply via email to