...
| Code Block | ||||
|---|---|---|---|---|
| ||||
sub read_users {
open( my $filehandle, "<", "/etc/shadow")
or return;
my @users = <$filehandle>;
return @users;
}
|
Exceptions
EXP00-PL-EX1: This recommendation applies specifically to functions called in a list context. If you can guarantee that some function will never be called in a list context, then that function may return undef.
...
Improper interpretation of return undef can lead to incorrect program flow.
Recommendation | Severity | Likelihood | Remediation Cost | Priority | Level |
|---|---|---|---|---|---|
EXP00-PL | Low | Unlikely | Low | P3 | L3 |
Automated Detection
Tool | Diagnostic |
|---|---|
Perl::Critic | Subroutines::ProhibitExplicitReturnUndef |
PERL_D102 |
Bibliography
| [Conway 2005] | "Returning Failure," p. 199 |
| [CPAN] | Elliot Shank, Perl-Critic-1.116 ProhibitOneArgSelect |
|---|
...
...