develooper Front page | perl.perl5.porters | Postings from January 2001

[PATCH @8382] Remove FileHandle/IO dependence in t/io/openpid.t

Thread Next
From:
Stephen McCamant
Date:
January 9, 2001 13:33
Subject:
[PATCH @8382] Remove FileHandle/IO dependence in t/io/openpid.t
Message ID:
14939.33475.474459.147429@soda.csua.berkeley.edu
As previously mentioned, this is another small step toward getting
minitest working again.

 -- Stephen McC

--- t/io/openpid.t.orig	Mon Dec 11 21:31:50 2000
+++ t/io/openpid.t	Sun Dec 31 22:18:12 2000
@@ -16,10 +16,8 @@
     }
 }
 
-
-use FileHandle;
 use Config;
-autoflush STDOUT 1;
+$| = 1;
 $SIG{PIPE} = 'IGNORE';
 
 print "1..10\n";
@@ -33,10 +31,8 @@
 # the other reader reads one line, waits a few seconds and then
 # exits to test the waitpid function.
 #
-$cmd1 = qq/$perl -e "use FileHandle; autoflush STDOUT 1; / .
-        qq/print qq[first process\\n]; sleep 30;"/;
-$cmd2 = qq/$perl -e "use FileHandle; autoflush STDOUT 1; / .
-        qq/print qq[second process\\n]; sleep 30;"/;
+$cmd1 = qq/$perl -e "\$|=1; print qq[first process\\n]; sleep 30;"/;
+$cmd2 = qq/$perl -e "\$|=1; print qq[second process\\n]; sleep 30;"/;
 $cmd3 = qq/$perl -e "print <>;"/; # hangs waiting for end of STDIN
 $cmd4 = qq/$perl -e "print scalar <>;"/;
 
@@ -76,7 +72,8 @@
 print "ok 8\n";
 
 # send one expected line of text to child process and then wait for it
-autoflush FH4 1;
+select(FH4); $| = 1; select(STDOUT);
+
 print FH4 "ok 9\n";
 print "# waiting for process $pid4 to exit\n";
 $reap_pid = waitpid $pid4, 0;

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About