You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Alexei V. Alexandrov" <av...@elcomsoft.com> on 2000/05/25 12:55:20 UTC

[newbie]: Catching apache output.

Hello modperl,

  The problem i would like to solve is that i want to catch the actual
  output from the apache. I have bought "Writing apache modules with
  perl and C" there are two examples on how to write thing like Echo
  or NavBar. These two scripts just parse the actual file that is
  requested by the client. The thing i want to make is that a module
  written in perl can catch the output (any script [php, cgi, etc.],
  any html file) and parse the output and make some changes to it (say
  like parsing href tags). Where should i look?

Best regards,
Alexei V. Alexandrov                   [AA4460, AVA32-RIPN, AA1829-RIPE]
------------------------------------------------------------------------
*** Alexei V. Alexandrov --- www.elcomsoft.com --- ava@elcomsoft.com ***
------------------------------------------------------------------------



Re: [newbie]: Catching apache output.

Posted by Ask Bjoern Hansen <as...@valueclick.com>.
On Thu, 25 May 2000, Alexei V. Alexandrov wrote:

[...]
>   written in perl can catch the output (any script [php, cgi, etc.],
>   any html file) and parse the output and make some changes to it (say
>   like parsing href tags). Where should i look?

That's not possible with apache 1.3. It's planned for the apache 2 series.

If all your modules are perl modules there is some workarounds to make it
possible.


 - ask 

-- 
ask bjoern hansen - <http://www.netcetera.dk/~ask/>
more than 70M impressions per day, <http://valueclick.com>


Re: [newbie]: Catching apache output.

Posted by Matt Sergeant <ma...@sergeant.org>.
On Thu, 25 May 2000, Alexei V. Alexandrov wrote:

> Hello modperl,
> 
>   The problem i would like to solve is that i want to catch the actual
>   output from the apache. I have bought "Writing apache modules with
>   perl and C" there are two examples on how to write thing like Echo
>   or NavBar. These two scripts just parse the actual file that is
>   requested by the client. The thing i want to make is that a module
>   written in perl can catch the output (any script [php, cgi, etc.],
>   any html file) and parse the output and make some changes to it (say
>   like parsing href tags). Where should i look?

The short and sweet of it is that you can't. Apache doesn't cache the
output before sending it like some web servers (Roxen comes to mind), it
sends it as you "print" so you can't. There are things you can do.. for
example if your modules are all mod_perl modules you can use the
techniques used by the Filter/Chain modules, or what AxKit does is
overload Apache.pm's print() method and catches the output that way.

Hope that helps...

-- 
<Matt/>

Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org http://xml.sergeant.org