From: chromatic Date: Fri, 13 Sep 2002 14:26:08 +0000 (-0700) Subject: [REPATCH lib/AutoLoader.pm] Remove Dependency on Exporter (take 2 or 3) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=04c1a02be98ce9945e4da9b8fdb006d61420b34d;p=p5sagit%2Fp5-mst-13.2.git [REPATCH lib/AutoLoader.pm] Remove Dependency on Exporter (take 2 or 3) Message-Id: <200209131426.08116.chromatic@wgz.org> p4raw-id: //depot/perl@17948 --- diff --git a/lib/AutoLoader.pm b/lib/AutoLoader.pm index b42d5ff..b20b5dd 100644 --- a/lib/AutoLoader.pm +++ b/lib/AutoLoader.pm @@ -1,7 +1,9 @@ package AutoLoader; +use strict; use 5.006_001; -our(@EXPORT, @EXPORT_OK, $VERSION); + +our($VERSION, $AUTOLOAD); my $is_dosish; my $is_epoc; @@ -9,14 +11,11 @@ my $is_vms; my $is_macos; BEGIN { - require Exporter; - @EXPORT = @EXPORT = (); - @EXPORT_OK = @EXPORT_OK = qw(AUTOLOAD); $is_dosish = $^O eq 'dos' || $^O eq 'os2' || $^O eq 'MSWin32' || $^O eq 'NetWare'; $is_epoc = $^O eq 'epoc'; $is_vms = $^O eq 'VMS'; $is_macos = $^O eq 'MacOS'; - $VERSION = '5.59'; + $VERSION = '5.60'; } AUTOLOAD { @@ -93,6 +92,7 @@ AUTOLOAD { eval { local $SIG{__DIE__}; require $filename }; if ($@) { if (substr($sub,-9) eq '::DESTROY') { + no strict 'refs'; *$sub = sub {}; } else { # The load might just have failed because the filename was too @@ -124,8 +124,9 @@ sub import { # if ($pkg eq 'AutoLoader') { - local $Exporter::ExportLevel = 1; - Exporter::import $pkg, @_; + no strict 'refs'; + *{ $callpkg . '::AUTOLOAD' } = \&AUTOLOAD + if @_ and $_[0] =~ /^&?AUTOLOAD$/; } #