in reply to Re^2: What to test in a new module
in thread What to test in a new module
It's safer to explicitly return as otherwise the value of the last expression is returned.
He did say "unless you intentionally are returning undef". I agree with stevieb on that point; however, in my code if I am intentionally returning undef I make that explicit with return(); I never use return; in my code unless I am returning early from a sub which is not expected to return a value. (If the caller insists on doing something with the returned value from such a sub, TNMP.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: What to test in a new module
by swl (Prior) on Jul 08, 2023 at 05:56 UTC | |
by jdporter (Paladin) on Jul 10, 2023 at 14:14 UTC | |
by choroba (Cardinal) on Jul 11, 2023 at 18:22 UTC | |
by jdporter (Paladin) on Jul 11, 2023 at 18:43 UTC |