Re: Custom INC per-directory

2009-10-20 Thread Devin Teske
Ended up just knocking out the PerlSetEnv LIBDIR in favor of giving librequire a new first variable of $r and basing the lib path off of $r->filename() Why $r->filename() you say? Because $r->uri() is before any Alias translations with mod_alias. -- Devin Teske - Original Message -

Re: Custom INC per-directory

2009-10-20 Thread Devin Teske
Hehe, it does seem kind of looney, doesn't it? In a broad scope (see last e-mail which explains the benefits we gain), it is solving a real problem. For example, which might be efficient enough... # ... my $MOD = SomeMod; sub handler() { # ... if ( $INC{$MOD} ne $ENV{'LIBDIR'}/$MOD )

Re: Custom INC per-directory

2009-10-20 Thread Devin Teske
Hey All, I'll try to answer multiple people's questions/suggestions in one e-mail. (and I notice that there are 2 more that I haven't read et from Adam and Brad). Use of 'Parent' implies that different virtual hosts. Imagine thusly... You want to run what are essentially "different websites

Re: Custom INC per-directory

2009-10-20 Thread Brad Van Sickle
I don't know the specifics of your project so it's quite possible that I'm missing something, but this all seems like an incredibly bad idea. Sure you can knock some cringe inducing code together and get it to technically work, but the very fact that you need to resort to these sort of unortho

Re: Custom INC per-directory

2009-10-20 Thread Adam Prime
Alan Young wrote: Wouldn't using the Parent option ( http://perl.apache.org/docs/2.0/user/config/config.html#C_Parent_ ) work better for what you're trying to do? Parents requires vhosts, which he said he doesn't want to use. Adam

Re: Custom INC per-directory

2009-10-20 Thread Alan Young
Wouldn't using the Parent option ( http://perl.apache.org/docs/2.0/user/config/config.html#C_Parent_ ) work better for what you're trying to do? -- Alan

Re: Custom INC per-directory

2009-10-20 Thread Michael Peters
On 10/20/2009 05:24 PM, Perrin Harkins wrote: Performance will suffer, but it will work for most code. Right. Your Perl interpreter will be persistent, but none of your code will be cached and thus every module you use will be reloaded on every request. It also means you can't do pretty stan

Re: Custom INC per-directory

2009-10-20 Thread Perrin Harkins
On Tue, Oct 20, 2009 at 5:16 PM, Devin Teske wrote: > the problem is that 'require' and 'use' want to conditionally not re- > import the library based on the module name (which doesn't change)... > > ...the solution is to not use 'use' or 'require' and instead beat down > on the INC hash yourself,

Re: Custom INC per-directory

2009-10-20 Thread Devin Teske
Ok, my last attempt, which involved using blocks, didn't work either (and I know why). Here's the final solution that is working 100% of the time. So... the problem is that 'require' and 'use' want to conditionally not re- import the library based on the module name (which doesn't change)...

Re: Custom INC per-directory

2009-10-20 Thread Devin Teske
Yes, but that's a horrible solutions (thinking "utter nightmare" when it comes to system administration, et. al.). I've currently got it working with this (which seems to be MUCH more elegant, only requires a single Apache server, no virtual-hosts, is directory-based, and requires no special conf

Re: GnuPG module producing empty files

2009-10-20 Thread Michael Schout
Laurent MARTIN wrote: > Has anyone on the list some experience with mod_perl and an alternative > to GnuPG module (which is "simply" a wrapper around pgp binary). I use GnuPG::Interface, and it works fine. Regards, Michael Schout

Re: Custom INC per-directory

2009-10-20 Thread Michael Peters
On 10/20/2009 01:06 PM, Devin Teske wrote: I've been trying for what feels like months now to find some way to have two directories specify the same module name to PerlInitHandler but to use two different modules. This isn't a limitation of mod_perl but a limitation of Perl. You can't have 2

Re: Custom INC per-directory

2009-10-20 Thread Devin Teske
Well, I was thinking I could get away with something like this... foo's .htaccess: use ModPerl::Util; ModPerl::Util::unload_package(MyAuth::Authnz); unshift(@INC, '/modules/foo'); push @PerlInitHandler, 'MyAuth::Authnz'; bar's .htaccess: use ModPerl::Util; ModPerl::Util::unload_p

Re: Custom INC per-directory

2009-10-20 Thread Clinton Gormley
> For example, I'd like to be able to have: > > File 1: /usr/foo/.htaccess: > PerlInitHandler MyAuth::Authnz.pm > # We want this to load /modules/foo/MyAuth/Authnz.pm > > > File 2: /usr/bar/.htaccess: > PerlInitHandler MyAuth::Authnz.pm > # We want this to load /modules/bar/MyAuth/Authnz.pm Th

Custom INC per-directory

2009-10-20 Thread Devin Teske
Hi there, list, I've been trying for what feels like months now to find some way to have two directories specify the same module name to PerlInitHandler but to use two different modules. For example, I'd like to be able to have: File 1: /usr/foo/.htaccess: PerlInitHandler MyAuth::Authnz.pm # We

DBI Connectons accumulate under Mod_perl

2009-10-20 Thread Artem Kuchin
Hello! I have a very weird situation. I use MYSQL. Apache 2.2 with mod_perl2 O use Modperl::RegistryBB to run the script, but the script itself is written very nicely for mod_perl. That is no globals at all. Everything is in sub handler. I do not use Apache::DBI, just plain "use DBI;" So, what

Re: ApacheCon 2009 in Oakland

2009-10-20 Thread Jeff Trawick
On Mon, Oct 19, 2009 at 12:15 AM, Fred Moyer wrote: > Greetings, > > Is anyone here attending ApacheCon in Oakland this year?  I am > organizing a mod_perl social.  I'll be at the conference at least one > day hacking mod_perl. This lurker will be there.