diff options
author | chromatic <chromatic@wgz.org> | 2002-10-03 15:56:54 -0700 |
---|---|---|
committer | hv <hv@crypt.org> | 2002-10-11 11:55:53 +0000 |
commit | 7412bda796ef0f9c3874e537e0357f96cf6f16e3 (patch) | |
tree | 00958764f9601f7289629a2f41c9affe5f54f214 /lib/AutoLoader.pm | |
parent | c801bddb79887dcdaa40b9af734318a8be202252 (diff) | |
download | perl-7412bda796ef0f9c3874e537e0357f96cf6f16e3.tar.gz |
[PROPOSED PATCH lib/AutoLoader.t lib/AutoLoader.pm] Test and Improve unimport()
Message-ID: <20021004060120.33329.qmail@onion.perl.org>
p4raw-id: //depot/perl@17996
Diffstat (limited to 'lib/AutoLoader.pm')
-rw-r--r-- | lib/AutoLoader.pm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/AutoLoader.pm b/lib/AutoLoader.pm index b20b5dde39..3afe4af559 100644 --- a/lib/AutoLoader.pm +++ b/lib/AutoLoader.pm @@ -167,8 +167,12 @@ sub import { } sub unimport { - my $callpkg = caller; - eval "package $callpkg; sub AUTOLOAD;"; + my $callpkg = caller; + + no strict 'refs'; + my $symname = $callpkg . '::AUTOLOAD'; + undef *{ $symname } if \&{ $symname } == \&AUTOLOAD; + *{ $symname } = \&{ $symname }; } 1; |