Retract #8552.
[p5sagit/p5-mst-13.2.git] / t / lib / io_tell.t
index 5a706fb..65c63bd 100755 (executable)
@@ -1,14 +1,24 @@
 #!./perl
 
-# $RCSfile: tell.t,v $$Revision: 1.1 $$Date: 1996/05/01 10:52:47 $
+BEGIN {
+    unless(grep /blib/, @INC) {
+       chdir 't' if -d 't';
+       @INC = '../lib';
+       $tell_file = "TEST";
+    }
+    else {
+       $tell_file = "Makefile";
+    }
+}
+
+use Config;
 
 BEGIN {
-    chdir 't' if -d 't';
-    @INC = '../lib' if -d '../lib';
-    require Config; import Config;
-    if ($Config{'extensions'} !~ /\bIO\b/ && !($^O eq 'VMS')) {
-       print "1..0\n";
-       exit 0;
+    if(-d "lib" && -f "TEST") {
+        if ($Config{'extensions'} !~ /\bIO\b/ && $^O ne 'VMS') {
+           print "1..0\n";
+           exit 0;
+        }
     }
 }
 
@@ -16,8 +26,8 @@ print "1..13\n";
 
 use IO::File;
 
-$tst = IO::File->new("TEST","r") || die("Can't open TEST");
-
+$tst = IO::File->new("$tell_file","r") || die("Can't open $tell_file");
+binmode $tst; # its a nop unless it matters. Was only if ($^O eq 'MSWin32' or $^O eq 'dos');
 if ($tst->eof) { print "not ok 1\n"; } else { print "ok 1\n"; }
 
 $firstline = <$tst>;