Hi All,

I am currently helping some friends convert their site over to mod_perl,
and they are experiencing some problems due to the fact that they use
function prototypes. Whenever they change a function prototype, mod_perl
complains that they have 'too few' or 'too many' arguments for the
function. 
I tried including Apache::Symbol so that undef_functions would get
called, but the problem persisted. I looked into the Apache::Symbol
code, and found the chunk in undef_functions that does the actual
undef'ing:

    for my $cv (@functions) {
        no strict 'refs';
    next if substr($cv, 0, 14) eq "Devel::Symdump";
        next if $skip and $cv =~ /$skip/;
        #warn "$cv=", *{$cv}{CODE}, "\n";
        Apache::Symbol::undef(*{$cv}{CODE});
        undef(*$cv);
    }


It looks like the problem is that it is undef'ing the code of the
procedure, but not the procedure's symbol table function name entry
itself (which seems to carry the prototype information). 
So I modified it so that it undef's everything:

    next if substr($cv, 0, 14) eq "Devel::Symdump";
        next if $skip and $cv =~ /$skip/;
        #warn "$cv=", *{$cv}{CODE}, "\n";

        # we want everything undef'd, not just the code
        undef(*$cv);
    }

Things seem to work ok now, but my question is this:

Is the above modification going to have any adverse effects?
Why in the original are the symbol table function name entries left
around and not undef'd entirely?


Thanks,
-- 
-jeff elo

Reply via email to