develooper Front page | perl.perl5.porters | Postings from February 2013

Re: [perl #116659] closing STDIN causes warning when openingunrelated file

Thread Previous | Thread Next
Eirik Berg Hanssen
February 7, 2013 14:47
Re: [perl #116659] closing STDIN causes warning when openingunrelated file
Message ID:
On Thu, Feb 7, 2013 at 2:56 PM, David Golden <> wrote:

> On Wed, Feb 6, 2013 at 2:08 PM, Aaron Crane <> wrote:
> > I don't know what hoops Capture::Tiny jumps through in this case, but
> > AFAICT, that logic should work in Perl space just as well as in C
> > space.
> If I recall, if it sees STDIN closed, it opens it to
> File::Spec->devnull for the duration of the capture (while monkeying
> around extensively with handles) and then closes it again afterwards.

  I'd rather perl did not jump through that particular hoop without being
asked ...

  Beyond performance and wasted file handles, I'd say something about not
trying to keep people from doing stupid things, as that would also keep
them from doing clever things.

  But why is there even a warning here?  I read perldiag, but found no

  (What might break?  Do some system prevent output on file handle 0?
Could a child process inherit this fd0, and blow up since it is opened, but
not for reading?)

  If there really is a reason, it'd be nice if perldiag gave it. :)


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