On Thu, Feb 7, 2013 at 3:32 PM, Eirik Berg Hanssen <Eirik-Berg.Hanssen@allverden.no> wrote: > That seems like a perfectly good answer – to a different question. ;-) It was the answer to why we should stay of fd 0 and avoid the problem. In answer to your question, probably because having a write-only handle on a descriptor that programs expect to read from makes them crash: # run2.pl use v5.10; use strict; use warnings; use lib '.'; close STDIN; open my $fh, ">", "foo.xt"; say "opened on fd " . fileno $fh; say `/bin/cat`; ### $ perl run2.pl Filehandle STDIN reopened as $fh only for output at run2.pl line 8. opened on fd 0 cat: stdin: Bad file descriptor -- David Golden <xdg@xdg.me> Take back your inbox! → http://www.bunchmail.com/ Twitter/IRC: @xdgThread Previous | Thread Next