Skip Menu |

This queue is for tickets about the IO-Tee CPAN distribution.

Report information
The Basics
Id: 4956
Status: new
Priority: 0/
Queue: IO-Tee

People
Owner: Nobody in particular
Requestors: kconnor [...] proofpoint.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.64
Fixed in: (no value)



Subject: can't set STDERR to an IO::Tee object
redirecting stderr to an io::tee object causes stderr output to disappear this code (stderr.t) produces the following output: #!/usr/bin/perl -w use Test::More (tests => 4); use IO::Tee; use IO::File; stderrtest(new IO::File(">teebug1.out")); stderrtest(new IO::Tee(\*STDOUT, ">teebug1.out")); sub stderrtest { my $io = shift; open(STDERR, ">&", $io); print STDERR "\nSTDERR: output\n"; select $io; print "plain test.\n"; my $filecontents = `cat teebug1.out`; ok($filecontents =~ /plain/m); ok($filecontents =~ /STDERR/m, 'STDERR'); } output: 1..2 ok 1 ok 2 - STDERR plain test. ok 3 not ok 4 - STDERR # Failed test (stderr.t at line 22) This is perl, v5.8.1 built for i686-linux-thread-multi Linux codemasters 2.4.21-4.ELsmp #1 SMP Fri Oct 3 17:52:56 EDT 2003 i686 i686 i386 GNU/Linux
I'm not sure this is a valid bug after all. It seems just a general limitation that you can't dup a tied file handle and it's a bad thing to try.