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

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

Thread Previous | Thread Next
From:
David Golden
Date:
February 6, 2013 17:59
Subject:
Re: [perl #116659] closing STDIN causes warning when openingunrelated file
Message ID:
CAOeq1c-SMRqMfcC1CLZhtebNFcQ8FbG9d9Bhc94DKRqH4Hbasg@mail.gmail.com
On Tue, Feb 5, 2013 at 9:07 PM, Leon Timmermans <fawaka@gmail.com> wrote:
> Why would you want to do this in the first place?

It's slightly worse than that.  If you close STDIN and then your
program requires a module, the handle for loading it will wind up on
fd 0, too.

Capture::Tiny goes through some hoops to avoid that, but it would be
nice if the core could find a way to stay off fd 0 (assuming a
sufficiently portable way to do so exists).

David

-- 
David Golden <xdg@xdg.me>
Take back your inbox! → http://www.bunchmail.com/
Twitter/IRC: @xdg

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