Closed DrHyde closed 3 years ago
Tightly-scoped no warnings 'newline' in the chunk of code that tries to figure out whether something is a file or a string of JSON, to avoid unnecessarily spitting out a warning when it's a JSON string that ends in a newline.
no warnings 'newline'
The warning is wrong and confusing.
https://github.com/mojolicious/json-validator/issues/232
Isn't a chomp the easier fix?
Errm, yes, if I'd remembered it existed :-)
Thanks!
Summary
Tightly-scoped
no warnings 'newline'
in the chunk of code that tries to figure out whether something is a file or a string of JSON, to avoid unnecessarily spitting out a warning when it's a JSON string that ends in a newline.Motivation
The warning is wrong and confusing.
References
https://github.com/mojolicious/json-validator/issues/232