aboutsummaryrefslogtreecommitdiff
path: root/contrib/perl5/lib/Symbol.pm
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/perl5/lib/Symbol.pm')
-rw-r--r--contrib/perl5/lib/Symbol.pm11
1 files changed, 9 insertions, 2 deletions
diff --git a/contrib/perl5/lib/Symbol.pm b/contrib/perl5/lib/Symbol.pm
index a842c1cd7beb..a95383a5d68c 100644
--- a/contrib/perl5/lib/Symbol.pm
+++ b/contrib/perl5/lib/Symbol.pm
@@ -129,8 +129,15 @@ sub delete_package ($) {
my $stem_symtab = *{$stem}{HASH};
return unless defined $stem_symtab and exists $stem_symtab->{$leaf};
- my $leaf_glob = $stem_symtab->{$leaf};
- my $leaf_symtab = *{$leaf_glob}{HASH};
+
+ # free all the symbols in the package
+
+ my $leaf_symtab = *{$stem_symtab->{$leaf}}{HASH};
+ foreach my $name (keys %$leaf_symtab) {
+ undef *{$pkg . $name};
+ }
+
+ # delete the symbol table
%$leaf_symtab = ();
delete $stem_symtab->{$leaf};