This has come up a few times but I still do not fully understand how it works. Here is my situation.

I have a body of software that runs in a specific namespace with about 10 libraries. (TourEngine::**). I have many versions of this software and will need the ability to, on the same server, run multiple instances of this software with different versions for a variety of reasons.

Using a PerlRequire in the vhost seems to add the @INC for the entire vhost population on the server, not just my vhost. This results in 'first match wins' behavior since I would now have an @INC entry for each TourEngine::** directory. I tried Apache::PerlVINC but it wants to reload each module on each request and it seems to want to 'own' a location space. My modules actually get required as part of my HTML::Mason code, they do not handle the entire Location.

I tried the PerlFixupHandler and a use libs declaration but that just gave me error messages like 'Undefined subroutine &lib(use::handler called.' which makes me think I have the syntax wrong there and I can not find another syntax example.

My preference is not to have to set my @INC in every component/lib I call but to have it set in the config globally for that Vhost.

So, does anyone have any ideas on how I can load a per vhost @INC that doesn't appear to other Vhosts? I want my TourEngine::** namespace to be a unique @INC per vhost.

Thanks
John-

Reply via email to