don't rely on package::stash's remove_package_symbol implementation
Jesse Luehrs [Sat, 13 Nov 2010 21:13:18 +0000 (15:13 -0600)]
lib/namespace/clean.pm

index 156bde0..c208de0 100644 (file)
@@ -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]);
+        }
     }
 };