On 6/27/05, Philip M. Gollucci <[EMAIL PROTECTED]> wrote:
> Douglas Riordan wrote:
> 
> >from Apache2::Const's perldoc
> >use Apache2::Const qw(OK);
> >compiles imports the OK constant.
> >
> >use Apache2::Const -compile => qw(OK);
> >only compiles the OK constant in which case i would have to use
> >return Apache2::Const::OK
> >
> >
> I agree with the perldoc.
> 
> Whats this coming from then ?
> 
> Constant subroutine My::OK redefined at
> /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/ModPerl/Util.pm
> line 66.

look for *** line 66 *** below

sub unload_package_pp {
    my $package = shift;
    no strict 'refs';
    my $tab = \%{ $package . '::' };

    # below we assign to a symbol first before undef'ing it, to avoid
    # nuking aliases. If we undef directly we may undef not only the
    # alias but the original function as well

    for (keys %$tab) {
        my $fullname = join '::', $package, $_;
        # code/hash/array/scalar might be imported make sure the gv
        # does not point elsewhere before undefing each
        if (%$fullname) {
            *{$fullname} = {};
            undef %$fullname;
        }
        if (@$fullname) {
            *{$fullname} = [];
            undef @$fullname;
        }
        if ($$fullname) {
            my $tmp; # argh, no such thing as an anonymous scalar
            *{$fullname} = \$tmp;
            undef $$fullname;
        }
        if (defined &$fullname) {
            no warnings;
            local $^W = 0;
            if (defined(my $p = prototype $fullname)) {
                *{$fullname} = eval "sub ($p) {}"; # <-- *** line 66 ***
            }
            else {
                *{$fullname} = sub {};
            }
            undef &$fullname;
        }

i'm not 100% sure why but it would appear warnings are not being
disabled.  i can live with it (or perhaps i'm doing something wrong in
my code), but the i need to fix what appears to be apache2::reload
causing apache to segfault.  restarting apache dozens and dozens of
times to avoid it is not fun.

doug riordan

Reply via email to