>>>>> "Sean" == Sean Chittenden <[EMAIL PROTECTED]> writes:

Sean>   There are a few ways to go about this one, but here's the solution
Sean> that I'd use.

Sean>   1)  Install a PerlTransHandler that sets the URI to / or whatever
Sean> you want to have your PerlHandler work with.  Have the transhandler return
Sean> DECLINED if $r->uri =~ m:^/images/:o;

Sean>   2)  Install a PerlHandler that builds the response for the web.

Or a variation of that, that I like... set up a TransHandler like this:

    sub handler { # PerlTransHandler
      return DECLINED unless $r->uri eq "/";
      $r->set_handler("perl-script");
      $r->push_handlers( PerlHandler => sub {
        ... your code goes here
      }
      return OK;
    }

No need to mess with $r->uri, which will be very confusing if there's
an error.


Sean>   The advantage to doing it this way is:

Sean>   a)  this was what apache was designed for (multiple phases)
Sean>   b)  allows other handlers to kick in before you build the response
Sean> (such as mod_access)

Absolutely.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Reply via email to