summaryrefslogtreecommitdiff
path: root/t/io.pipe
blob: c4cb2f753767f4fc03646f3c521b8bbf1761cb4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!./perl

# $Header: io.pipe,v 2.0 88/06/05 00:13:05 root Exp $

$| = 1;
print "1..4\n";

open(PIPE, "|-") || (exec 'tr', '[A-Z]', '[a-z]');
print PIPE "OK 1\n";
print PIPE "ok 2\n";
close PIPE;

if (open(PIPE, "-|")) {
    while(<PIPE>) {
	print;
    }
}
else {
    print stdout "ok 3\n";
    exec 'echo', 'ok 4';
}