X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FUNIVERSAL.pm;h=8808271ef9837032d1c129544ec3b0eaf5e1f1b2;hb=8af3c3489f0c9ca8d37ebae27991ac4f34dfdb2f;hp=7b7bfc4058a40a6bbbfbfd70d47ab3105622c227;hpb=2af1ab88da52f38a7450a6455bc28aa93c8e4e57;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/UNIVERSAL.pm b/lib/UNIVERSAL.pm index 7b7bfc4..8808271 100644 --- a/lib/UNIVERSAL.pm +++ b/lib/UNIVERSAL.pm @@ -1,6 +1,6 @@ package UNIVERSAL; -our $VERSION = '1.01'; +our $VERSION = '1.02'; # UNIVERSAL should not contain any extra subs/methods beyond those # that it exists to define. The use of Exporter below is a historical @@ -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__