Bruce Johnson wrote:
> I'm getting this error:
>
> [Thu Sep 17 10:52:13 2009] [error] Undefined subroutine
> &ModPerl::ROOT::ModPerl::PerlRunPrefork::home_oraweb_perl_avi_login_2epl::PrintHeader
> called at /home/oraweb/perl/avi/login.pl line 43, <FH1> line 71.\n
> [Thu Sep 17 10:52:13 2009] [error] [client 65.55.106.207] malformed
> header from script. Bad header=_OF_FUNC: login.pl
> [Thu Sep 17 10:52:13 2009] [warn] /avi/login.pl did not send an HTTP header
>
> The undefined subroutine IS defined; it's loaded via a line:
>
> require "avi-defaults";
>
> And the subroutine is just:
>
> sub PrintHeader {
> return "Content-type: text/html\n\n";
> }
>
>
> The line as called in login.pl is just:
>
> print &PrintHeader;
>
> Now this subroutine is called *throughout* the application, as you might
> guess, every time we write a html page for display, the app is comprised
> of about 40-50 different scripts.
>
> Heck, every CGI perl script on our server uses the same code, which is
> defined in the '<appname>-defaults' file for each application.
I am going to hazard a guess that the other scripts run under mod_perl
(as opposed to CGI) too. If not, then you might want to check
http://perl.apache.org/docs/1.0/guide/porting.html for help in porting
the scripts.
It might not be a bad idea even otherwise, since it has a very thorough
explanation of a very similar looking scenario (scenario 1):
http://perl.apache.org/docs/1.0/guide/porting.html#Name_collisions_with_Modules_and_libs
Hope this helps.
-Tuomo