Stas Bekman wrote:
Philippe M. Chiasson wrote:
[...]

Philippe, has the allowed placement of <Perl> sections changed in mp2?


For now, <Perl> sections are still limited to server scope. I have a patch to open that up to OR_ALL (<Location> .htaccess and all) but I am not sure of exactly what behaviour a user would expect from a <Perl> section in a <Location > container. For example

<Location /foo>
 <Perl>
   $Global::SomeVar = 'foo';
 </Perl>
</Location>

<Location /bar>
 <Perl>
   $Global::SomeVar = 'bar';
 </Perl>
</Location>

Would certainly _not_ behave like people might expect. See what I mean ?


True. I suppose in mp1 it was just running them all at the server startup, having the latest value override the previous, isn't it?

Yup!

So we should either keep it as it was in mp1, or make it DWIM. If we keep the mp1 behavior we ought to allow it everywhere, but document that it's not DWIM. How hard would it be to make it DWIM? I suppose one will need to stash code-refs into the dir/r struct and run them at request time, which won't work across threads, so the source will need to be stored. doesn't seem very effective to me.

Yes, exactly! If it were a simple matter to get them to run per directory/ location, I might have tried it. It just doesn't seem like it would be worth spending time on implementing such a feature that, really, would just be misusing what <Perl> sections were for.

One is ought to use the PerlHeaderParserHandler to accomplish DWIM in the example above.

Yes, I was just making a bad example of what someone _might_ do.

So I think it's the most sane to keep mp1's behavior. i.e.:

- allow <Perl> everywhere

Yes, and like I pointed out before, they would be executed for every requests in the .htaccess cases.

- document that it's not DWIM (i.e. everythings is run at the server startup)

+1

--
--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/     F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5

Attachment: signature.asc
Description: OpenPGP digital signature



Reply via email to