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

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

Thread Previous | Thread Next
From:
Abigail
Date:
October 17, 2003 07:25
Subject:
Re: [perl #24204] Dupping STDERR for reading.
Message ID:
20031017142502.GA5832@abigail.nl
On Fri, Oct 17, 2003 at 03:07:06PM +0100, Nick Ing-Simmons wrote:
> 
> >Finally, in Perl, including 5.8.1 and 5.9.0, dupping file-descriptor 2
> >for reading works fine. This works ok:
> >
> >    open STDERRIN, "<&2" or die $!;
> 
> Which seems to make a bizare kind of sense - that is how shell does 
> it after all so this makes your quote above true ;-)
> 
> >
> >and this doesn't:
> >
> >    open STDERRIN, "<&STDERR" or die $!;
> 
> What does
> 
>      open STDERRIN, "<&=STDERR" or die $!;

Identical results as with "<&STDERR", works fine in 5.005 and 5.6.0,
warns (but works) in 5.6.1, fails in 5.8.x.

> Come to that does 
> 
>      open STDERRIN, "<+&STDERR" or die $!;
> 
> help ? 

No, that just gives 'no such file or directory'. And using

       open STDERRIN, "+<&STDERR" or die $!;

gives identical results as

       open STDERRIN, "<&STDERR" or die $!;


Abigail

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About