Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/utgwkk/perl-critic-policy-prohibitorreturn
Policy of Perl::Critic (do not use `or return`)
https://github.com/utgwkk/perl-critic-policy-prohibitorreturn
Last synced: about 1 month ago
JSON representation
Policy of Perl::Critic (do not use `or return`)
- Host: GitHub
- URL: https://github.com/utgwkk/perl-critic-policy-prohibitorreturn
- Owner: utgwkk
- License: other
- Created: 2020-03-09T10:25:03.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-16T02:07:00.000Z (about 4 years ago)
- Last Synced: 2024-10-15T00:23:16.546Z (2 months ago)
- Language: Perl
- Homepage: https://metacpan.org/pod/Perl::Critic::Policy::ProhibitOrReturn
- Size: 24.4 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
# NAME
Perl::Critic::Policy::ProhibitOrReturn - Do not use \`or return\`
# AFFILIATION
This policy is a policy in the [Perl::Critic::Policy::ProhibitOrReturn](https://metacpan.org/pod/Perl%3A%3ACritic%3A%3APolicy%3A%3AProhibitOrReturn) distribution.
# DESCRIPTION
Avoid using `or return`. Consider using equivalent `if` (or `unless`) statement instead.
# not ok
sub foo {
my ($x) = @_;
$x or return;
...
}# ok
sub foo {
my ($x) = @_;
return if !$x;
...
}# CONFIGURATION
This Policy is not configurable except for the standard options.
# LICENSE
Copyright (C) utgwkk.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.# AUTHOR
utgwkk