X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FAutoLoader.pm;h=ad6bc4013b77878bd755ea19b45e0af2b6093072;hb=191740791d4b6865c4f2665c148ea4f4d8ec7cc3;hp=af33ee80f85e09d23a9bbb6c765ab06710c48147;hpb=ed79a026b5aec9cc3f786c2971aa15a4b21f396c;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/AutoLoader.pm b/lib/AutoLoader.pm index af33ee8..ad6bc40 100644 --- a/lib/AutoLoader.pm +++ b/lib/AutoLoader.pm @@ -6,6 +6,7 @@ our(@EXPORT, @EXPORT_OK, $VERSION); my $is_dosish; my $is_epoc; my $is_vms; +my $is_macos; BEGIN { require Exporter; @@ -14,7 +15,8 @@ BEGIN { $is_dosish = $^O eq 'dos' || $^O eq 'os2' || $^O eq 'MSWin32'; $is_epoc = $^O eq 'epoc'; $is_vms = $^O eq 'VMS'; - $VERSION = '5.57'; + $is_macos = $^O eq 'MacOS'; + $VERSION = '5.58'; } AUTOLOAD { @@ -38,7 +40,12 @@ AUTOLOAD { my ($pkg,$func) = ($sub =~ /(.*)::([^:]+)$/); $pkg =~ s#::#/#g; if (defined($filename = $INC{"$pkg.pm"})) { - $filename =~ s#^(.*)$pkg\.pm\z#$1auto/$pkg/$func.al#s; + if ($is_macos) { + $pkg =~ tr#/#:#; + $filename =~ s#^(.*)$pkg\.pm\z#$1auto:$pkg:$func.al#s; + } else { + $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', @@ -61,7 +68,7 @@ AUTOLOAD { # XXX todo by VMSmiths $filename = "./$filename"; } - else { + elsif (!$is_macos) { $filename = "./$filename"; } }