You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Steve Wells <we...@cedarnet.org> on 2001/06/17 16:49:36 UTC

Capturing CGI output

I have a mod_perl library that utilizes the Tempate Toolkit so that html
files are parsed through the toolkit before being sent back to the
browser.  It works great but now they require that the library be
upgraded to include support for CGI's.  In other words I need to capture
the output of the CGI as though it were a template and parse it as well.

I can use $r->lookup_uri('/cgifile.cgi') to gather up the subrequest and
run it using the run() command.  However, the information from the CGI
is passed back to the browser instead of handed off to me for
processing.  Is there some way to capture that information?

Thanks,
STEVE

Re: Capturing CGI output

Posted by Perrin Harkins <pe...@elem.com>.
From: "Steve Wells" <we...@cedarnet.org>
> I can use $r->lookup_uri('/cgifile.cgi') to gather up the subrequest and
> run it using the run() command.  However, the information from the CGI
> is passed back to the browser instead of handed off to me for
> processing.  Is there some way to capture that information?

You could use LWP to make the request instead of using a subrequest, or you
could use a modified version of Apache::PerlRun or Apache::Registry that
fakes CGI and captures the output.  You can look at Apache::Filter for some
ideas.

- Perrin