On Wed, Feb 6, 2013 at 2:33 AM, Jim Avera <perlbug-followup@perl.org> wrote: > Not saying this is a bug, but it seems wrong to not permit > STDIN to be closed: > > perl -we 'close STDIN; open my $fh,">/dev/null";' > Filehandle STDIN reopened as $fh only for output at -e line 1. > > It sounds like Perl implicitly re-opens STDIN when fd 0 gets > re-used for something else. It might be better to not complain > about this but die later if the handle STDIN is ever actually > opened and the fd does not end up being zero. You just closed STDIN(fd=0) The underlying system allocates the lowest fd available (at this point always fd=0) This leads to a nonsensible situation, so perl gives a warning. Why would you want to do this in the first place? LeonThread Previous | Thread Next