Many functions return useful values whether or not the function has side effects. In most cases, this value is used to signify signifies whether the function successfully completed its task or if some error occurred. Other times, the value is the result of some computation and is an integral part of the function's API.
...
EXP32:EX2: Functions that send data to standard output or standard error need not have their return values checked. This includes print and printf, but only if their filehandle file handle argument is not supplied or is explicitly set to *STDOUT or *STDERR. If they send their output to any other filehandlefile handle, their return value must be checked.
...
Tool | Version | Checker | Description |
|---|---|---|---|
Perl::Critic | 5.0 | InputOutput::RequireCheckedClose | Implemented |
...
CERT C Secure Coding Standard: EXP12-C. Do not ignore values returned by functions
The CERT Oracle Secure Coding Standard for Java: EXP00-J. Do not ignore values returned by methods
Bibliography
...
| 2005] |
|---|
...
| "Error Checking," p. 208 | |
|---|---|
| [CPAN] | autodie |
| [Open Group 2008] | open() |
...