Philippe M. Chiasson wrote:


Stas Bekman wrote:

Philippe M. Chiasson wrote:


Geoffrey Young wrote:


Perrin Harkins wrote:


On Fri, 2004-08-13 at 11:06, Geoffrey Young wrote:



you can't do that with mod_perl 1.0 - you can $sub->run() but that result
goes right to the client.




For comparison, how would you do this in mp2? With a filter?




pretty much. I believe that subrequests in apache2 have the same
limitations as before wrt calling run(). but if the main reason you want to
capture a subrequest is to post-process dynamic content then you can simply
insert an output filter to do that for you, as that is what they were
designed for.



Nah, you can do it in a much cleaner way in mp2.

See http://perl.apache.org/docs/2.0/api/Apache/SubRequest.html#C_lookup_uri_,

but basically you can

my $data;
my $subr = $r->lookup_uri($uri, $filter);
$subr->run;

And $filter can be a very simple output filter that just stashes data as it
comes out or anything else you feel like doing.



Hmm, and where do you get this $filter object from? Do you have a working example?


Hmm, I think you just got me there. I didn't think long enough before answering
that one ;-)


I can see why one can't do that now that I've looked at code for a few minutes,
and sorry for misleading anybody on this one.

Ah, no, I think it's quite do-able, I just thought that you had an example at hand. The $filter argument is just a pointer to somewhere in the filter chain. So I suppose on could add a filter for the subrequest and pass $filter: $subr->output_filters. But as I don't have a test, I can't vouch for it to work. If you want I can write a test for it later, but now I need to resolve if a few other issues first. So let me know if you want me to work on this.



-- __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com

--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Reply via email to