perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Foertsch <torsten.foert...@gmx.net>
Subject Re: [MP2]how to catch the response body of a subrequest?
Date Tue, 01 Jul 2008 12:13:45 GMT
On Tue 01 Jul 2008, titetluc titetluc wrote:
> I am facing a problem: I would like to call sub-requests, but the content
> of these sub-requests should not 'pollute' the main request.

  my $content='';
  my $subr=$r->lookup_uri( $tmpl );
  $subr->add_output_filter( sub {
			      my ($f, $bb) = @_;
			      while (my $e = $bb->first) {
				$e->read(my $buf);
				$content.=$buf;
				$e->delete;
			      }
			      return Apache2::Const::OK;
			    } );
  $subr->run;

Torsten

--
Need professional mod_perl support?
Just hire me: torsten.foertsch@gmx.net

Mime
View raw message