Title: mod_perl startup sequence?

I'm confused about when mod_perl loads Perl Modules. It appears my perl module gets loaded twice: once when the log writes to stdout, and once when the log message is written to error-log.

I would expect my module to only get loaded once. Why twice?

To help me trace loading, I added "print STDERR" statements to my .conf file and my perl module. To my surprise, log messages go to the console, and messages go the log file 30 milliseconds later. Also, the Apache::Server::Starting is 1 first time through, and 0 the second time through. NOTE: PerlFreshRestart is NOT defined.

For example, this appears on my console:
# .conf started at 983839924.241642, Starting = 1, ReStarting=0
# wierd.pm started at 983839924.274978, Starting = 1, ReStarting=0
# .conf finished at 983839924.277637

And this appears in my error-log:
# .conf started at 983839924.285614, Starting = 0, ReStarting=0
# wierd.pm started at 983839924.292273, Starting = 0, ReStarting=0
# .conf finished at 983839924.294823

Notice the difference in execution times (1st ends at 983839924.277637 and the 2nd one starts at 983839924.285614).


Here's my simplified .conf
<Perl>
        use Time::HiRes qw( time );
        print STDERR "# .conf started at " . time() . "\n";
</Perl>
PerlModule wierd.pm
<Location /my_wierd>
        SetHandler      perl-script
        PerlHandler     wierd
</Location>
<Perl>
        use Time::HiRes qw( time );
        print STDERR "# .conf finished at " . time() . "\n";
</Perl>


And here's my simplified wierd.pm
package wierd;
use strict;
use Time::HiRes qw( time );

print STDERR "# wierd.pm loaded at " . time() . "\n";
return 1;


TIA,

drew
==============

Reply via email to