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

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

Thread Previous | Thread Next
October 15, 2003 03:45
Re: [perl #24204] Dupping STDERR for reading.
Message ID:
On Tue, Oct 14, 2003 at 11:35:00PM -0400, Mark Jason Dominus wrote:
> 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.

Whether or not it's hokey isn't the point. Fact is that one used to
be able to dup STDERR and open it for reading, and now you no longer
can. Neither perldelta nor perl58delta mentions this, nor was it
deprecated, so I don't think this was an intentional decision. 
Therefore, I would classify it as a low priority bug.


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