perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Hay <>
Subject Re: [Fwd: Apache::Reload Module]
Date Wed, 18 Jun 2003 16:51:02 GMT
Hi Philippe,

Philippe M. Chiasson wrote:

>On Wed, 2003-06-18 at 17:19, Steve Hay wrote:
>>I've attached a patch for Apache::Reload that makes use of your code to 
>>achieve what I'm after.  The patch is against the Apache::Reload 
>>currently in mp2 cvs.  Things to note:
>Can you instead look at this patch:
>And integrate that into an mod_perl 1 & 2 Apache::Reload instead? I
>would rather not have to maintain 2 ever so slightly different versions
>of Apache::Reload if that can be avoided.
Done. Attached.

I had to alter the patch that you cited above very slightly: it defers 
the import of the OK constant until run-time, which made it choke on the 
bareword OK (since its running under "use strict").  I've therefore 
pushed the mp1/mp2 conditional stuff inside a BEGIN {} block.

I've also added a couple of extra lines to conditionally setup an 
undef_func() -- under mp1 it is just Apache::Symbol::undef, under mp2 it 
will be ModPerl::Util::undef which you suggested in the rest of your 
mail (below).

The only other thing that I was using from Apache::Symbol was the 
file2class() function. I've now included that in Apache::Reload itself 
as module_to_package(), complementing the package_to_module() that it 
already had.

So there is no need to put Apache::Symbol back into mp2 -- just copy its 
undef() to ModPerl::Util as you suggested, and hopefully this 
Apache::Reload will work with mp1 and mp2.

I've re-tested it under mp1 and it still looks OK.  I don't have an mp2 
system to try out, though.


>>I've quickly tested this mp1-compatible version, and it seems to be 
>>working so far: no "subroutine redefined" warnings are being produced 
>>(not even for constant subroutines), and imported subroutines are not 
>>being mistakenly undefined.  I hope this can be added to mp1.28 (which 
>>already has Apache::Symbol, of course).
>Just might ;-)
>I guess Apache::Symbol might need to be re-created for mp2.  According
>to :
>$> fgrep Apache::Symbpl mp2/docs/deprecated_features.txt
>  + Apache::Symbol: unknown
>There are only 3 functions in there, and they are:
>I don't see why we can't find some room for those somewhere in mp2,
>especially the magical 'undef' function in there.
>Stas: BTW, for Apache::Reload, to get rid of that constant subroutine
>redefined, that XS implemtation would get rid of it without a need for
>skip_redefine_const_sub_warn. No more $SIG{__WARN__} ;-)
>How about if I ported Apache::Symbol::undef to ModPerl::Util::undef ?
>Gozer out to bed.

View raw message