develooper Front page | perl.perl5.porters | Postings from October 2003

Re: [perl #24204] Dupping STDERR for reading.

Thread Previous | Thread Next
Mark Jason Dominus
October 14, 2003 20:34
Re: [perl #24204] Dupping STDERR for reading.
Message ID:

Michael G Schwern <>:
> On Tue, Oct 14, 2003 at 08:39:27AM -0000, (via RT) wrote:
> > A recent discussion on Perlmonks revealed that older versions
> > of Perl allowed you to dup STDERR for reads, but newer versions
> > don't. Opening STDERR for reading is a useful trick to be able
> > to read input from the keyboard if STDIN was redirected.
> Errr, I don't understand how that would work.  Why would keyboard input
> be going to STDERR?

By default, STDERR is open to the terminal device.  

The idea sounds pretty hokey to me, and less reliable than just
opening /dev/tty.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About