pcouderc has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks,
I am not sure it is the right place to call for help as the problem could come from modperl and not perl.
I have a good perl code that works usually very fine, but sometimes, I get the error :
[Fri May  2 14:46:31 2003] [error] Undefined subroutine &Apache::ROOT::tools::crm::genindex_2epl::gencalendar called at ./genliste.pl line 112.
It is not truly an undefined subroutine, first because I have declared it (ok, I admit it is not a good reason), secondly because usually it works, that is, I have no error and good results. It is not a change in parameters, because when it fails, if I retry (resending the same URL to Apache), it usually works.
But I have no idea of a reason for that unstability.
Thank you for any idea

Replies are listed 'Best First'.
Re: Strange results in modperl and Apache
by hardburn (Abbot) on May 02, 2003 at 16:31 UTC

    Could it be that one (or more) of the Apache's child processes didn't update its cache the last time the code changed? You could try restarting Apache (if you can, that is).

    ----
    I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
    -- Schemer

    Note: All code is untested, unless otherwise stated

      You can find more information about Apache's caching of your code (and how to fix problems caused by it) in the Reloading Modules and Required Files section of the mod_perl porting documentation.
      I can and I did. But my code does not change. it works... except when it does not!
Re: Strange results in modperl and Apache
by nite_man (Deacon) on May 02, 2003 at 21:18 UTC
    Use Apache::Reload for reload your modules which were changed:
    package YourPackage; use Apache::Reload; . . . 1;
    and Apache will check modification time of your modules and reload them.
          
    --------------------------------
    SV* sv_bless(SV* sv, HV* stash);
    
Re: Strange results in modperl and Apache
by pcouderc (Monk) on May 03, 2003 at 08:39 UTC
    Following your wise advices, I have learnt to turn on various traces in modperl (StatINC), and the problem appears now on a new light : in some cases
    require 'gencalendar.pl';
    does not load it and gives :
    Apache::StatINC: Can't locate gencalendar.pl
    but in some cases it success locate it...
    I thank you all, serach more and start a new node on this somehow different problem if I do not find.