Justin Luster wrote:
Is there a way in Perl code to clear out the cached code in the registry?
From lib/Modperl-Registry/lib/Modperl/RegistryCooker.pm:
#########################################################################
# this is a function should be called from the registry script, and
# using the caller() method we figure out the package the script was
# compiled into and trying to uncache it.
#
# it's currently used only for testing purposes and not a part of the
# public interface. it expects to find the compiled package in the
# symbol table cache returned by cache_table_common(), if you override
# cache_table() to point to another function, this function will fail.
sub uncache_myself {
my $package = scalar caller;
my($class) = __PACKAGE__->cache_table_common();
unless (defined $class) {
Apache2->warn("$$: cannot figure out cache symbol table for
$package");
return;
}
if (exists $class->{$package} && exists $class->{$package}{mtime}) {
Apache2->warn("$$: uncaching $package\n") if DEBUG & D_COMPILE;
delete $class->{$package}{mtime};
}
else {
Apache2->warn("$$: cannot find $package in cache");
}
}
--
END
------------------------------------------------------------
What doesn't kill us can only make us stronger.
Nothing is impossible.
Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
http://www.liquidityservicesinc.com
http://www.liquidation.com
http://www.uksurplus.com
http://www.govliquidation.com
http://www.gowholesale.com