From: Jesse Luehrs Date: Sat, 13 Nov 2010 21:13:18 +0000 (-0600) Subject: don't rely on package::stash's remove_package_symbol implementation X-Git-Tag: 0.19~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ad4b1a60b4de126e867f1426c33ed5fe969fd45e;p=p5sagit%2Fnamespace-clean.git don't rely on package::stash's remove_package_symbol implementation --- diff --git a/lib/namespace/clean.pm b/lib/namespace/clean.pm index 156bde0..c208de0 100644 --- a/lib/namespace/clean.pm +++ b/lib/namespace/clean.pm @@ -166,7 +166,14 @@ my $RemoveSubs = sub { } } - $cleanee_stash->remove_package_symbol($variable); + my ($scalar, $array, $hash, $io) = map { + $cleanee_stash->get_package_symbol($_ . $f) + } '$', '@', '%', ''; + $cleanee_stash->remove_package_glob($f); + for my $var (['$', $scalar], ['@', $array], ['%', $hash], ['', $io]) { + next unless defined $var->[1]; + $cleanee_stash->add_package_symbol($var->[0] . $f, $var->[1]); + } } };