summaryrefslogtreecommitdiff
path: root/lib/UNIVERSAL.pm
diff options
context:
space:
mode:
authorMichael G. Schwern <schwern@pobox.com>2003-10-06 06:14:36 -0700
committerAbhijit Menon-Sen <ams@wiw.org>2003-10-07 03:59:38 +0000
commit2bfd56816acd10b1f958d1dde1769bafd756cbea (patch)
treed0d59d224550c05170ca0c02065b8506bd6587d2 /lib/UNIVERSAL.pm
parent209071589ddd827372bd46e1358d1d13f6b4dbcb (diff)
downloadperl-2bfd56816acd10b1f958d1dde1769bafd756cbea.tar.gz
Fixing UNIVERSAL.pm's bit of unpleasantness
Message-Id: <20031006131436.G20960@ttul.org> p4raw-id: //depot/perl@21418
Diffstat (limited to 'lib/UNIVERSAL.pm')
-rw-r--r--lib/UNIVERSAL.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/UNIVERSAL.pm b/lib/UNIVERSAL.pm
index 7b7bfc4058..c5f22eb4e9 100644
--- a/lib/UNIVERSAL.pm
+++ b/lib/UNIVERSAL.pm
@@ -9,9 +9,15 @@ our $VERSION = '1.01';
# Exporter. It's bad enough that all classes have a import() method
# whenever UNIVERSAL.pm is loaded.
require Exporter;
-*import = \&Exporter::import;
@EXPORT_OK = qw(isa can VERSION);
+# Make sure that even though the import method is called, it doesn't do
+# anything unless its called on UNIVERSAL
+sub import {
+ return unless $_[0] eq __PACKAGE__;
+ goto &Exporter::import;
+}
+
1;
__END__