-
Notifications
You must be signed in to change notification settings - Fork 560
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
print returns error when succeed #14221
Comments
From efimov@reg.ruRunning the following scriptuse strict;
|
From @cpansproutProbably related to #116082. -- Father Chrysostomos |
The RT System itself - Status changed from 'new' to 'open' |
From efimov@reg.ru2014-11-08 22:54 GMT+03:00 Father Chrysostomos via RT
I can neither confirm nor deny this. And other similar bugs I've seen with perlio are usually related to
|
From @tonycozOn Sat Nov 08 11:13:33 2014, efimov@reg.ru wrote:
This happens because Perl_do_print()'s return value is based on the error state of the stream, not on the success or failure of the current operation. This has been the case since at least 1994 (before PerlIO). If you want to work with the current behaviour, you can clear the error state on each write failure, eg: unless (print $f "Hey\n") { There is a bug in that the documentation says that print returns true if the current operation succeeds, but that's incorrect. I can see two possible fixes here: 1) update the documentation to print() to say it returns false if the stream is in an error state, or 2) modify Perl_do_print() to return false iff the current operation failed. Tony |
Migrated from rt.perl.org#123158 (status was 'open')
Searchable as RT123158$
The text was updated successfully, but these errors were encountered: