Subject: | Reloading packages in a persistent enviroment |
Hello
I expired some problems regarding reloading of packages in a persistent environment. I managed to find the problem, Symbol::delete_package($classname) seems not to remove the package from $INC. Replacing Symbol::delete_package with delete $INC{ $pmfile }; solves the problem.
I hope you will apply the patch.
Best Regards
Christian Hansen
--- Text-PSP-1.012/lib/Text/PSP.pm Mon Mar 14 17:49:33 2005
+++ Text-PSP-1.012-local/lib/Text/PSP.pm Mon May 2 02:31:59 2005
@@ -140,7 +140,7 @@
my ($self,$filename,%options) = @_;
my ($pmfile,$classname) = $self->translate_filename($filename);
if ( $options{force_rebuild} or ( !-f $pmfile ) or -M _ > -M "$self->{template_root}/$filename" ) {
- Symbol::delete_package($classname);
+ delete $INC{ $pmfile };
$self->write_pmfile($filename,$pmfile,$classname);
}
require $pmfile;
@@ -176,7 +176,7 @@
croak "Cannot find $filename from directory $directory" unless $found;
my ($pmfile,$classname) = $self->translate_filename("$directory/$filename");
if ( $options{force_rebuild} or ( !-f $pmfile ) or -M _ > -M "$self->{template_root}/$path/$filename" ) {
- Symbol::delete_package($classname);
+ delete $INC{ $pmfile };
$self->write_pmfile($filename,$pmfile,$classname,$directory);
}
require $pmfile;