summaryrefslogtreecommitdiff
path: root/t/io.pipe
blob: 49eaeec9595b6cf74446f2123fe07e56d2d05857 (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 3.0 89/10/18 15:26:30 lwall Locked $

$| = 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';
}