>Number: 4500
>Category: general
>Synopsis: apache configured with 'embedded perl' does not find
>subroutine.
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: apache
>State: open
>Class: sw-bug
>Submitter-Id: apache
>Arrival-Date: Mon May 31 07:50:00 PDT 1999
>Last-Modified:
>Originator: [EMAIL PROTECTED]
>Organization:
apache
>Release: 1.3.4
>Environment:
suse linux 6.1
>Description:
I think I found something like a bug in 'embedded Perl'
in apache 1.3.4 that came with my suse 6.1 distribution:
When calling /cgi-bin/test.pl from Netscape about 10 times
I get an internal server error in 70% of the calls. The other
30% work fine. Apache or Perl do not find a subroutine.
The httpd.error_log message:
httpd: [Mon May 31 16:17:10 1999] [error] Undefined subroutine
&Apache::ROOT::cgi_2dbin::ihtmlctrl_2epl::OUTFILE called at
/usr/local/httpd/cgi-bin/test.pl line 18.
After -disbling- the following lines in httpd.conf
<Location /cgi-bin>
AddHandler perl-script .pl
PerlHandler Apache::Registry
PerlSendHeader On
Options +ExecCGI
</Location>
everything worked well.
/cgi-bin/test.pl:
-----------------
#!/usr/bin/perl
require "httpdio.pl";
&OUTFILE("test.pl", 0, 0, 0);
httpdio.pl:
-----------
# Syntax: &OUTFILE( $Dateiname, $p1 ,$p2, $zeile)
# bei $p1 = 0 wird kein "Content-type: text/html\n\n" ausgegeben,
# bei $p1 = 1 schon
#
# bei $p2 = n wird an n ter Zeile $zeile ausgegeben.
#
sub OUTFILE {
my $z = 0;
if ( @_ > 0 ) {
open( FILE, $_[0] );
if ( $_[1] == 1 ) {
print "Content-type: text/html\n\n" }
if ( $_[2] > 0 ) {
while(defined($i = <FILE>)) {
$z++;
if ($z == $_[2]) {
print $_[3];
print $i;
}
else {
print $i
}
}
}
else {
while(defined($i = <FILE>)) {
print $i
}
}
close(FILE);
}
}
1;
>How-To-Repeat:
>Fix:
Diabling embedded perl
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, you need]
[to include <[EMAIL PROTECTED]> in the Cc line and make sure the]
[subject line starts with the report component and number, with ]
[or without any 'Re:' prefixes (such as "general/1098:" or ]
["Re: general/1098:"). If the subject doesn't match this ]
[pattern, your message will be misfiled and ignored. The ]
["apbugs" address is not added to the Cc line of messages from ]
[the database automatically because of the potential for mail ]
[loops. If you do not include this Cc, your reply may be ig- ]
[nored unless you are responding to an explicit request from a ]
[developer. Reply only with text; DO NOT SEND ATTACHMENTS! ]