Skip to content
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

$buffer->print should return a truthy value on success. #4

Open
afresh1 opened this issue Dec 19, 2020 · 0 comments
Open

$buffer->print should return a truthy value on success. #4

afresh1 opened this issue Dec 19, 2020 · 0 comments

Comments

@afresh1
Copy link

afresh1 commented Dec 19, 2020

Currently Catalyst expects ->print to return a truthy value on success. This is is likely because that's how perl's internal print works. That seems like a reasonable API and what most people using this module would expect. Currently it the return value appears to be undocumented, so clarifying that and making it always truthy should not break things.

While normally returning the thing printed would be a truthy value, ->print(0) or ->print("") would not.

I did also file a Catalyst-Runtime bug letting them know they're not correctly using String::Buffered and pointing them at this issue.

melmothx added a commit to melmothx/Stream-Buffered that referenced this issue May 14, 2021
As explained in GH#4, Catalyst is using the return value of the ->print
call. This fails if the chunk is a falsy string.

This patch makes the return value consistent with the File backend.

Address plack#4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant