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

Report information
The Basics
Id:
128168
Status:
new
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
SREZIC [...] cpan.org
Cc:
AdminCc:

BugTracker
Severity:
(no value)
Broken in:
0.07
Fixed in:
(no value)



Subject: STDERR not autoflushed if used in tee()
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
Message-ID: <rt-4.0.18-18599-1546638296-77.0-0-0@rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 789
Normally STDERR is not buffered, but if it is used in tee(), then it does not seem to be buffered at all --- which is surprising at least. Consider the following script: #!/usr/bin/perl use strict; use File::Tee; my $logfile = "/tmp/test.log"; #STDERR->autoflush(1); #File::Tee::tee(\*STDERR, { autoflush => 1, open => $logfile }); print STDERR "Does it work? (y/n) "; <STDIN>; __END__ This is normal behavior --- the prompt appears. If the File::Tee::tee line is activated, then the prompt appears only after hitting RETURN. Workaround is to explictly activate autoflush on STDERR. But again, this is surprising. (Another thing: maybe the documentation might use the more modern ...->autoflush(1) syntax than using the old approach with setting $| and doing a select before and after)


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.