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

Remove explicit undef in return statement #22

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
1 participant
@paultcochrane
Contributor

paultcochrane commented Jul 20, 2016

According to Perl Best Practices, using an explicit undef to return
failure doesn't always work as one intended (e.g. in list context a single
elemnt list containing (undef) is returned which is true in boolean
context, and hence not what one wants. Removing the undef fixes the
perlcritic violation, keeps the tests passing and seems to maintain the
desired behaviour.

If you have any questions or comments concerning this patch, please don't hesitate to contact me! It is intended to be helpful, and if I can improve it, just let me know and I'll update the patch and resubmit.

Remove explicit undef in return statement
According to Perl Best Practices, using an explicit `undef` to return
failure doesn't always work as one intended (e.g. in list context a single
elemnt list containing `(undef)` is returned which is true in boolean
context, and hence not what one wants.  Removing the `undef` fixes the
`perlcritic` violation, keeps the tests passing and seems to maintain the
desired behaviour.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment