Geoffrey Young wrote:


Stas Bekman wrote:

Here is the problem. If a module fails to load once it must not be blacklisted. The test demonstrates how a module may fail if loaded from the wrong directory, but then is supposed to succeed if moved to a different directory.


this is somewhat addressed in the original thread:

http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2003-09/msg01486.html

http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2003-09/msg01518.html


I think Rick makes a good point - in a persistent environment like mod_perl the file contents (or location) ought not to change during production, and for development we have the Apache::Reload/PerlFreshRestart options. and, as it turns out, it's PerlFreshRestart that is the culprit here - it explicitly sets each %INC entry to undef to allow for a reload, which now is a problem, since undef is now the trigger for a bad attempt.
[...]
however, if perl isn't interested in changing current behavior, here is a patch that compensates for the changes within mod_perl.

+1 for this patch. Great job, Geoff!



Index: src/modules/perl/perl_util.c
===================================================================
RCS file: /home/cvspublic/modperl/src/modules/perl/perl_util.c,v
retrieving revision 1.52
diff -u -r1.52 perl_util.c
--- src/modules/perl/perl_util.c        14 Mar 2003 05:03:16 -0000      1.52
+++ src/modules/perl/perl_util.c        30 Oct 2003 15:28:24 -0000
@@ -500,10 +500,9 @@
                                   "%s not found in %%INC\n", elts[i].key));
                continue;
            }
-           SvREFCNT_dec(HeVAL(entry));
-           HeVAL(entry) = &sv_undef;
-           MP_TRACE_g(fprintf(stderr, "reloading %s\n", HeKEY(entry)));
-           perl_require_pv(HeKEY(entry));
+            hv_delete_ent(hash, keysv, G_DISCARD, 0);
+           MP_TRACE_g(fprintf(stderr, "reloading %s\n", elts[i].key));
+           perl_require_pv(elts[i].key);
        }
        SvREFCNT_dec(keysv);
     }


--


__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to