[inseparable changes from patch from perl5.003_15 to perl5.003_16]
[p5sagit/p5-mst-13.2.git] / t / lib / io_pipe.t
index 6f9d30c..1d050ff 100755 (executable)
@@ -1,11 +1,21 @@
 #!./perl
 
+
 BEGIN {
-    @INC = '../lib';
-    require Config; import Config;
-    if ($Config{'extensions'} !~ /\bIO\b/ && $^O ne 'VMS') {
-       print "1..0\n";
-       exit 0;
+    unless(grep /blib/, @INC) {
+       chdir 't' if -d 't';
+       @INC = '../lib' if -d '../lib';
+    }
+}
+
+use Config;
+
+BEGIN {
+    if(-d "lib" && -f "TEST") {
+        if ($Config{'extensions'} !~ /\bIO\b/ && $^O ne 'VMS') {
+           print "1..0\n";
+           exit 0;
+        }
     }
 }
 
@@ -35,7 +45,7 @@ elsif(defined $pid)
  }
 else
  {
-  die "# error = $!";
+  die;
  }
 
 $pipe = new IO::Pipe;