We are in the process of moving from strictly CGI to a mod_perl environment.
Since I know 
we have many CGI programs that will not run correctly under mod_perl, I want
to run them 
using the Apache::PerlRun handler instead of the Apache::Registry.  We just
have too many 
programs to recode.

I included directives in the httpd.conf file to have all .cgi programs
handled by Apache::PerlRun 
and all .pl files to be handled by Apache::Registry.  The problem I am
having is using
CGI::Carp qw(fatalsToBrowser).  When scripts are run with Apache::Registry,
any fatal errors are 
output to the browser.  When scripts are run using the Apache::PerlRun
handler, the error is going
to the log and not the browser.  I just get Internal  Server Error displayed
in the browser.

Below are the Apache configuration directives and a sample program.  When
the program has a .pl 
extension, I get the error output in the browser.   When the same code is
run with a .cgi extension, 
the error only goes to the log.  Can anyone tell me what I am doing wrong?  

Thanks in advance.

Versions:  Apache 1.3.20   mod_perl 1.25  CGI.pm 2.753  CGI::Carp 1.20

<Files ~ "\.cgi$">
   SetHandler perl-script 
   PerlHandler Apache::PerlRun
   Options ExecCGI
   allow from all
   PerlSendHeader ON
</Files>

<Files ~ "\.pl$">
   SetHandler perl-script 
   PerlHandler Apache::Registry
   Options ExecCGI
   allow from all
   PerlSendHeader ON
</Files>

############################################################
SAMPLE PROGRAM


#!/usr/local/bin/perl -Tw


use CGI::Carp qw(fatalsToBrowser);
use CGI qw(-debug :standard);
use strict;

use diagnostics;

open(FILE, "</tmp/changes") || die("can't open file"); 
close(FILE) || die("can't close file");

print header(),
start_html(),
"testing....",
end_html;



Lee Anne Lester
Email: [EMAIL PROTECTED]


Reply via email to