X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FAutoLoader.pm;h=8fd7d3b8fe2a5e42f85320999586cc87ec2716f9;hb=413e5597fa15080977e13a1ad58f104914a75a31;hp=488030aa8542931eb436a0d8ec280f6cf831e5d2;hpb=7d4fbd985f152f93fb488c6a48bdc3521292ba39;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/AutoLoader.pm b/lib/AutoLoader.pm index 488030a..8fd7d3b 100644 --- a/lib/AutoLoader.pm +++ b/lib/AutoLoader.pm @@ -1,17 +1,18 @@ package AutoLoader; -use vars qw(@EXPORT @EXPORT_OK $VERSION); +use 5.005_64; +our(@EXPORT, @EXPORT_OK, $VERSION); my $is_dosish; my $is_vms; BEGIN { require Exporter; - @EXPORT = (); - @EXPORT_OK = qw(AUTOLOAD); + @EXPORT = @EXPORT = (); + @EXPORT_OK = @EXPORT_OK = qw(AUTOLOAD); $is_dosish = $^O eq 'dos' || $^O eq 'os2' || $^O eq 'MSWin32'; $is_vms = $^O eq 'VMS'; - $VERSION = '5.56'; + $VERSION = '5.57'; } AUTOLOAD { @@ -35,7 +36,7 @@ AUTOLOAD { my ($pkg,$func) = ($sub =~ /(.*)::([^:]+)$/); $pkg =~ s#::#/#g; if (defined($filename = $INC{"$pkg.pm"})) { - $filename =~ s#^(.*)$pkg\.pm$#$1auto/$pkg/$func.al#; + $filename =~ s#^(.*)$pkg\.pm\z#$1auto/$pkg/$func.al#s; # if the file exists, then make sure that it is a # a fully anchored path (i.e either '/usr/lib/auto/foo/bar.al', @@ -44,9 +45,9 @@ AUTOLOAD { # looked for 'lib/lib/auto/foo/bar.al', given @INC = ('lib'). if (-r $filename) { - unless ($filename =~ m|^/|) { + unless ($filename =~ m|^/|s) { if ($is_dosish) { - unless ($filename =~ m{^([a-z]:)?[\\/]}i) { + unless ($filename =~ m{^([a-z]:)?[\\/]}is) { $filename = "./$filename"; } } @@ -103,7 +104,10 @@ sub import { # Export symbols, but not by accident of inheritance. # - Exporter::export $pkg, $callpkg, @_ if $pkg eq 'AutoLoader'; + if ($pkg eq 'AutoLoader') { + local $Exporter::ExportLevel = 1; + Exporter::import $pkg, @_; + } # # Try to find the autosplit index file. Eg., if the call package @@ -225,7 +229,7 @@ lines: (my $constname = $sub) =~ s/.*:://; my $val = constant($constname, @_ ? $_[0] : 0); if ($! != 0) { - if ($! =~ /Invalid/) { + if ($! =~ /Invalid/ || $!{EINVAL}) { $AutoLoader::AUTOLOAD = $sub; goto &AutoLoader::AUTOLOAD; }