Re: [perl #21261] B::Terse not outputting correct constants or variable names
[p5sagit/p5-mst-13.2.git] / ext / DynaLoader / DynaLoader_pm.PL
index 7e1b8cb..05fe3f7 100644 (file)
@@ -77,6 +77,9 @@ $Is_VMS    = $^O eq 'VMS';
 $do_expand = $Is_VMS;
 $Is_MacOS  = $^O eq 'MacOS';
 
+my $Mac_FS;
+$Mac_FS = eval { require Mac::FileSpec::Unixish } if $Is_MacOS;
+
 @dl_require_symbols = ();       # names of symbols we need
 @dl_resolve_using   = ();       # names of files to link with
 @dl_library_path    = ();       # path to look for files
@@ -234,6 +237,7 @@ sub bootstrap {
     # It may also edit @modparts if required.
     $modfname = &mod2fname(\@modparts) if defined &mod2fname;
 
+    # Truncate the module name to 8.3 format for NetWare
        if (($^O eq 'NetWare') && (length($modfname) > 8)) {
                $modfname = substr($modfname, 0, 8);
        }
@@ -251,27 +255,21 @@ sub bootstrap {
        my $dir;
        if ($Is_MacOS) {
            my $path = $_;
+           if ($Mac_FS && ! -d $path) {
+               $path = Mac::FileSpec::Unixish::nativize($path);
+           }
            $path .= ":"  unless /:$/;
            $dir = "${path}auto:$modpname";
        } else {
            $dir = "$_/auto/$modpname";
        }
-       if ($^O ne 'NetWare') {
-               next unless -d $dir; # skip over uninteresting directories
-       }
-       else {
-               next if -f $dir; # skip over uninteresting directories
-       }
-
+       
+       next unless -d $dir; # skip over uninteresting directories
+       
        # check for common cases to avoid autoload of dl_findfile
        my $try = $Is_MacOS ? "$dir:$modfname.$dl_dlext" : "$dir/$modfname.$dl_dlext";
-       if ($^O ne 'NetWare') {
-               last if $file = ($do_expand) ? dl_expandspec($try) : ((-f $try) && $try);
-       }
-       elsif (!(-d $try)) {
-               last if $file = ($do_expand) ? dl_expandspec($try) : ($try);
-       }
-
+       last if $file = ($do_expand) ? dl_expandspec($try) : ((-f $try) && $try);
+       
        # no luck here, save dir for possible later dl_findfile search
        push @dirs, $dir;
     }
@@ -538,7 +536,9 @@ useless for accessing non-Perl libraries because it provides almost no
 Perl-to-C 'glue'.  There is, for example, no mechanism for calling a C
 library function or supplying arguments.  A C::DynaLib module
 is available from CPAN sites which performs that function for some
-common system types.
+common system types.  And since the year 2000, there's also Inline::C,
+a module that allows you to write Perl subroutines in C.  Also available
+from your local CPAN site.
 
 DynaLoader Interface Summary