New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
spurious warning when fd 1 gets re-opened for input #3905
Comments
From @nwc10$ perl -we 'close STDOUT; open FH, "/etc/motd" or die $!; warn fileno FH' That warning about 'stdout' opened for input only is spurious. It appeared somewhere bewteen 5.6.0 and 5.7.0 $ perl5.005 -we 'close STDOUT; open FH, "/etc/motd" or die $!; warn fileno FH' I don't have a 5.6.1 here to test with. [for some reason probably my fault perlbug is for 5.7.0, but "perl" is 5.7.1] Nicholas Clark Perl Info
|
From @andk > This is a bug report for perl from nick@talking.bollo.cx, > ----------------------------------------------------------------- > $ perl -we 'close STDOUT; open FH, "/etc/motd" or die $!; warn fileno FH' > That warning about 'stdout' opened for input only is spurious. > It appeared somewhere bewteen 5.6.0 and 5.7.0 Accoring to my archive these two and 5.6.1 were OK and "it" happened |
From @nwc10Well, I had second thoughts. I *believe* that it might be helpful warning Anyway. I believe that this is a real bug, as my program fails: perl5.6.0 -we 'close STDOUT; open FH, "</etc/motd" or die but if I close FH before opening it for output again: perl5.6.0 -we 'close STDOUT; open FH, "</etc/motd" or die It works. Am I right in thinking that I shouldn't need to explicity close a filehandle [same bug in 5.7.0 and 5.7.1] Nicholas Clark PS Reason for all this closing of STDOUT is that Devel::Selfstubber spits all |
From [Unknown Contact. See original ticket]Does it write to STDOUT or just print without a handle? |
From [Unknown Contact. See original ticket]That was the intent of the warning. I am not 100% sure about it either,
You are correct - it should not be necessary.
"Good" - at least that means I haven't broken _that_ with PerlIO isms. |
From @nwc10So, to be consistent shouldn't close STDOUT; warn me if file descriptor 1 has become associated with a file as part of Probably that's a silly suggestion, but is more likely to cause problems as rather a lot of things assume that So should perl attempt to avoid descriptors 0,1,2 except for opens associated Nicholas Clark |
From [Unknown Contact. See original ticket]
Dunno, but there was at least one other bug report about this same http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2001-03/msg00745.html and the (short) thread that ensued. Since at least two people have been Cheers, |
From @jkeenanOn Sun Apr 22 08:38:17 2001, nick@talking.bollo.cx wrote:
The warning is still present, albeit with slightly different wording, in ### |
Still present in 5.30 |
Migrated from rt.perl.org#6875 (status was 'open')
Searchable as RT6875$
The text was updated successfully, but these errors were encountered: