On Thu, Jan 20, 2005 at 05:00:32PM -0500, Geoffrey Young wrote: > > > what technique would you use if you had to have a handler work > > exactly once, even though it may never be invoked as an initial > > request? > > if you're in prefork, off the top of my head I might set a perl global and > then reset it using a cleanup handler. something like > > $My::Foo::seen++; > $r->register_cleanup(sub { undef $My::Foo::seen });
hm, the reason why i did the thing with the notes is because i've seen similar constructs in C apache modules to avoid handler looping (i'm pretty sure mod_rewrite does it). what about unregistering the handler from the stack? is that possible? > so, again in prefork only, at the start of any request $My::Foo::seen should > be false. all bets are off if you're using threads. yeah, i'm staging in prefork (doing my best to write code that *looks* thread-safe) currently but i'm going to be wanting to move to worker as soon as possible. just to clarify: what *are* $r->next/prev if not a way to access the requests that have happened since the main, or is it only those which have happened via internal_redirect? are the subrequests generated by lookup_uri exempt from the list? .d