hi all...

        I'm not sure if this is related to some of the get/set handler
strangeness that I have been seeing lately (as I try to do some weird
stacked handler acrobatics), or if it's the result of some closure thing
that I really shouldn't be doing...

package Test::Test;
use Apache::Constants qw( OK );
use strict;
sub handler
{
    my $r = shift;
    warn "outside..." . $r->current_callback . $r->uri;
    $r->push_handlers(PerlCleanupHandler => sub { warn "inside..." .
$r->current_callback . $r->uri;
                                                  return OK;});
    return OK;
}
1;

anyway, for / => /index.html translation using mod_dir, this PerlInitHandler
produces:

outside...PerlInitHandler/ at /usr/lib/perl5/site_perl/5.005/Test/Test.pm
line 9.
outside...PerlInitHandler/index.html at
/usr/lib/perl5/site_perl/5.005/Test/Test.pm line 9.

inside...PerlCleanupHandler/ at /usr/lib/perl5/site_perl/5.005/Test/Test.pm
line 10.
inside...PerlFixupHandler/index.html at
/usr/lib/perl5/site_perl/5.005/Test/Test.pm line 10.


changing shift() to Apache->request() yields:

outside...PerlInitHandler/ at /usr/lib/perl5/site_perl/5.005/Test/Test.pm
line 10.
outside...PerlHandler/ at /usr/lib/perl5/site_perl/5.005/Test/Test.pm line
10.

inside...PerlCleanupHandler/ at /usr/lib/perl5/site_perl/5.005/Test/Test.pm
line 11.
inside...PerlCleanupHandler/ at /usr/lib/perl5/site_perl/5.005/Test/Test.pm
line 11.

which still isn't quite right, but sorta like what I might expect when
reading through mod_dir code and the ap_internal_redirect docs...

I tried playing around with setting $r in the anon subroutine too, but I
still can't get push_handlers to push code to the cleanup phase for the
internal redirect...

I guess the question I have is what's being shift()ed that for that second
pass and if the problem is just my code, mod_perl, mod_dir, or
not-a-problem/expected behavior...


fun, eh?

--Geoff

Reply via email to