diff options
author | Jason Downs <downsj@cvs.openbsd.org> | 1996-08-19 10:13:38 +0000 |
---|---|---|
committer | Jason Downs <downsj@cvs.openbsd.org> | 1996-08-19 10:13:38 +0000 |
commit | 14856225739aa48b6c9cf4c17925362b2d95cea3 (patch) | |
tree | dfd38f1b654fb5bbdfc38887c1a829b658e71530 /gnu/usr.bin/perl/t/io/dup.t | |
parent | 77469082517e44fe6ca347d9e8dc7dffd1583637 (diff) |
Import of Perl 5.003 into the tree. Makefile.bsd-wrapper and
config.sh.OpenBSD are the only local changes.
Diffstat (limited to 'gnu/usr.bin/perl/t/io/dup.t')
-rw-r--r-- | gnu/usr.bin/perl/t/io/dup.t | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gnu/usr.bin/perl/t/io/dup.t b/gnu/usr.bin/perl/t/io/dup.t new file mode 100644 index 00000000000..901642d8f66 --- /dev/null +++ b/gnu/usr.bin/perl/t/io/dup.t @@ -0,0 +1,32 @@ +#!./perl + +# $RCSfile: dup.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:27 $ + +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"; |