diff options
author | Larry Wall <lwall@netlabs.com> | 1991-03-21 00:00:00 +0000 |
---|---|---|
committer | Larry Wall <lwall@netlabs.com> | 1991-03-21 00:00:00 +0000 |
commit | fe14fcc35f78a371a174a1d14256c2f35ae4262b (patch) | |
tree | d472cb1055c47b9701cb0840969aacdbdbc9354a /t/io/dup.t | |
parent | 27e2fb84680b9cc1db17238d5bf10b97626f477f (diff) | |
download | perl-fe14fcc35f78a371a174a1d14256c2f35ae4262b.tar.gz |
perl 4.0.00: (no release announcement available)perl-4.0.00
So far, 4.0 is still a beta test version. For the last production
version, look in pub/perl.3.0/kits@44.
Diffstat (limited to 't/io/dup.t')
-rw-r--r-- | t/io/dup.t | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/t/io/dup.t b/t/io/dup.t new file mode 100644 index 0000000000..e5ea7d410d --- /dev/null +++ b/t/io/dup.t @@ -0,0 +1,32 @@ +#!./perl + +# $Header: dup.t,v 4.0 91/03/20 01:50:49 lwall Locked $ + +print "1..6\n"; + +print "ok 1\n"; + +open(dupout,">&STDOUT"); +open(duperr,">&STDERR"); + +open(STDOUT,">Io.dup") || die "Can't open stdout"; +open(STDERR,">&STDOUT") || die "Can't open stderr"; + +select(STDERR); $| = 1; +select(STDOUT); $| = 1; + +print STDOUT "ok 2\n"; +print STDERR "ok 3\n"; +system 'echo ok 4'; +system 'echo ok 5 1>&2'; + +close(STDOUT); +close(STDERR); + +open(STDOUT,">&dupout"); +open(STDERR,">&duperr"); + +system 'cat Io.dup'; +unlink 'Io.dup'; + +print STDOUT "ok 6\n"; |