...
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
.
...
Tool | Diagnostic |
---|---|
Perl::Critic | Subroutines::ProhibitExplicitReturnUndef |
Bibliography
[Conway 2005] | "Returning Failure," p. 199 | ||
[CPAN] | Elliot Shank, Perl-Critic-1.116 ProhibitOneArgSelect | [Conway 2005] | "Returning Failure," p. 199
---|
...