This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
lvref.t: do-block err msg is no longer to-do
[perl5.git] / install_lib.pl
index e116343..aa9945a 100644 (file)
@@ -9,9 +9,9 @@ use vars qw($Is_VMS $Is_W32 $Is_OS2 $Is_Cygwin $Is_Darwin $Is_NetWare
 use subs qw(unlink link chmod);
 require File::Path;
 
-use Config;
 BEGIN {
-    if ($Config{userelocatableinc}) {
+    require Config;
+    if ($Config::Config{userelocatableinc}) {
        # This might be a considered a hack. Need to get information about the
        # configuration from Config.pm *before* Config.pm expands any .../
        # prefixes.
@@ -19,7 +19,7 @@ BEGIN {
        # So we set $^X to pretend that we're the already installed perl, so
        # Config.pm does its ... expansion off that location.
 
-       my $location = $Config{initialinstalllocation};
+        my $location = $Config::Config{initialinstalllocation};
        die <<'OS' unless defined $location;
 $Config{initialinstalllocation} is not defined - can't install a relocatable
 perl without this.
@@ -34,8 +34,8 @@ OS
        # You never saw us. We weren't here.
 
        require Config;
-       Config->import;
     }
+    Config->import;
 }
 
 if ($Config{d_umask}) {
@@ -111,21 +111,20 @@ sub chmod {
       unless $opts{notify};
 }
 
-
 sub samepath {
     my($p1, $p2) = @_;
 
     return (lc($p1) eq lc($p2)) if ($Is_W32 || $Is_NetWare);
 
-    if ($p1 ne $p2) {
-       my($dev1, $ino1, $dev2, $ino2);
-       ($dev1, $ino1) = stat($p1);
-       ($dev2, $ino2) = stat($p2);
-       ($dev1 == $dev2 && $ino1 == $ino2);
-    }
-    else {
-       1;
-    }
+    return 1
+        if $p1 eq $p2;
+
+    my ($dev1, $ino1) = stat $p1;
+    return 0
+        unless defined $dev1;
+    my ($dev2, $ino2) = stat $p2;
+
+    return $dev1 == $dev2 && $ino1 == $ino2;
 }
 
 sub safe_rename {