On 6 Dec 1999, Martin Holz wrote:

> 
> I am trying to catch the output of a CGI
> script and put the body of the generated 
> HTML page in a template.
> 
> Works fine unless the CGI script calls CGI::header.
> If the scripts calls CGI::header, two headers
> are sent, the first by Apache::Registry/CGI.pm,
> the second by my own content handler.
>  
> Aparently CGI::header does not send its output
> to STDOUT, if it runs under Apache::Registry.
> 
> How can I intercept the first header?
> 
> Thanks
>       Martin Holz
> 
> 
> 
> ===============================================================
> 
> if ($r->filename =~ /\.perl$/ ) {  # Registry-Skript
>    tie *SH,'IO::Scalar', \$PAGE;
>    my $stdout = select SH;
>    Apache::Registry::handler($r);
>    select $stdout;    
> } else {
>   ... Static page
> }
> 
> Extract body from $page and put it a template
> 
 
any reason why you can't use HTML::Template?  it works beautifully for me,
both under a CGI/Registry format as well as mod_perl modules.

ky

Reply via email to