Greetings,

I'm investigating short term solutions for site performance (long term is a full rewrite of the app) and I'm working for the first time with ModPerl::PerlRun (and ModPerl::PerlRunPrefork, both seem to exhibit the same behavior) and feel like I'm missing something obvious.

I have this reduction (as test2.pl):

####################
#!/usr/bin/perl

use strict;
use warnings;

use Time::HiRes qw(time);

use CGI;
my $cgi = CGI->new();

print $cgi->header();
print "<h1>Hello World</h1>\n";
print "<h1>HiRes time is: ", time(), "</h1>\n";
#####################

The script runs properly as far as I can see, but I'm getting Prototype Mismatch warnings in the log with each hit after the first one:

Prototype mismatch: sub ModPerl::ROOT::ModPerl::PerlRunPrefork::var_www_test_test2_2epl::time: none vs () at /var/www/test/test2.pl line 6.

Other tests reveal it seems to happen pretty much anytime I import something from a module into the script. I also tried loading Time::HiRes into the startup (with and without the qw(time) import) and it didn't make a difference; still get the error the first time I run the script. If I make a copy of the script (say test3.pl), it will do the same thing: The first run of the script produces no warning (even after I've run test2 multiple times), but second and subsequent runs do produce the warning.

My test setup is pretty minimal; an empty startup script and this for my config:

PerlModule ModPerl::PerlRunPrefork Apache2::Status
PerlRequire /etc/apache2/startup/empty_startup.pl
<Location /perl-status>
    SetHandler perl-script
    PerlResponseHandler Apache2::Status
    PerlSetVar StatusOptionsAll On
    Require ip 127.0.0.1
</Location>
<VirtualHost *:443>
    SSLEngine On
    DocumentRoot /var/www/test
    <Directory /var/www/test>
            Options ExecCGI
            AddHandler perl-script .pl
            AllowOverride All
            PerlResponseHandler ModPerl::PerlRunPrefork
            Require all granted
    </Directory>
</VirtualHost>

Have I configured or otherwise set something up wrong? I'd rather not disable the warning and am puzzled as to what it's upset about.

mod_perl is version mod_perl/2.0.10 according to the perl-status environment display, though ModPerl::PerlRun shows in the module list at version 1.99 (don't know if that's expected or not). Apache is 2.4.38.

Thank you!

Dan

Reply via email to