[EMAIL PROTECTED] (Tim Bunce) wrote:

>On Fri, Dec 03, 1999 at 12:00:38PM -0500, Young, Geoffrey S. wrote:
>> that's what I meant :)
>> 
>> Since %INC is a hash, and it's order unpredictable, it's possible that DBI
>> be re-required before Apache::DBI.  But maybe something else is going on
>> too...
>> 
>> here's the code from the guide:
>> 
>> while (my($k,$v) = each %INC) {
>>       delete $INC{$k};
>>       require $k;
>> }
>
>Well that would certainly cause the problem.


I'm not so sure of that.  Isn't the following timeline accurate?
 
 1) Apache::DBI loads for the first time
 2) DBI loads for the first time, notices that Apache::DBI is loaded, and
    makes appropriate adjustments.
 3) ...time passes...
 4) PerlFreshRestart happens, and either DBI or Apache::DBI gets 
    deleted/reloaded first.  Either way, there will be an entry for 
    'Apache/DBI.pm' in %INC when DBI is reloaded.

Right?

It appears that the following XS code from perl_utils.c is actually
used, which (I think) is equivalent.

     void perl_reload_inc(void)
     {
         HV *hash = GvHV(incgv);
         HE *entry;
         I32 old_warn = dowarn;
         
         dowarn = FALSE;
         hv_iterinit(hash);
         while ((entry = hv_iternext(hash))) {
             char *key = HeKEY(entry);
             SvREFCNT_dec(HeVAL(entry));
             HeVAL(entry) = &sv_undef;
             MP_TRACE_g(fprintf(stderr, "reloading %s\n", key);)
             perl_require_pv(key);
         }
         dowarn = old_warn;
     }





  -------------------                            -------------------
  Ken Williams                             Last Bastion of Euclidity
  [EMAIL PROTECTED]                            The Math Forum

Reply via email to