Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

geoff (2013)

  reversethis-{gro ... om} {ta} {ffoeg}

see [] for personal information, links to presentations, GPG key, and so on.

Journal of geoff (2013)

Friday August 15, 2003
10:52 AM

translations and merges

[ #14140 ]
yesterday, I got involved in a conversation on the mod_perl list about using a PerlTransHandler within a <Location> section. of course you can't do this, given the configuration constraints of the directive. however, I had never fully realized the implications <Location> merging until right then.

see, apache actually merges <Location> directives twice - once just prior to the translation phase, then once right after. if you've ever written mod_perl directive handlers then you've probably seen your DIR_MERGE routine called twice per-request, which is the manifestation of this feature (it's also mentioned in a book I've heard about :). anyway, the docs (and code) say that the results of the first merge are thrown away, which they are. however, they are not thrown away until after translation. this means you can peek at what is inside of a <Location> block during translation.

now, of course, the reason you wouldn't want to do that is because some other translation handler can come in and alter the URI and *poof* you're not in the <Location> you thought you were, so it's completely unpredictable. however, it is a pretty cool thing to know, and if you're in complete control of your environment and know what you are doing, then it's a feature that's free to be abused.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.