This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl 2.0 (no announcement message available)
[perl5.git] / t / io.dup
CommitLineData
378cc40b
LW
1#!./perl
2
3# $Header: io.dup,v 2.0 88/06/05 00:12:57 root Exp $
4
5print "1..6\n";
6
7print "ok 1\n";
8
9open(dupout,">&stdout");
10open(duperr,">&stderr");
11
12open(stdout,">Io.dup") || die "Can't open stdout";
13open(stderr,">&stdout") || die "Can't open stderr";
14
15select(stderr); $| = 1;
16select(stdout); $| = 1;
17
18print stdout "ok 2\n";
19print stderr "ok 3\n";
20system 'echo ok 4';
21system 'echo ok 5 1>&2';
22
23close(stdout);
24close(stderr);
25
26open(stdout,">&dupout");
27open(stderr,">&duperr");
28
29system 'cat Io.dup';
30unlink 'Io.dup';
31
32print stdout "ok 6\n";