Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re^2: Truth and Falsehoodby haukex (Archbishop) |
on Aug 18, 2019 at 07:04 UTC ( [id://11104636]=note: print w/replies, xml ) | Need Help?? |
I suppose one could use sub f { return (); } if (f()) {}, but that's a very bad practice. (A sub that's expected to return a scalar should do so even in list context.) I agree that subs that are expected to return a scalar should do return undef because of the problems with my %hash = ( k => f() );, but there are also some good arguments against return undef in other cases - as you've said, there are exceptions. I mostly mentioned it because the old section "Truth and Falsehood" mentioned it, although with an attempt to improve the wording, as you've suggested yourself in the past. Update: I missed your ninja edits, but I hope I've cleared up your bafflement nonetheless. Please feel free to add any information you think is missing!
In Section
Meditations
|
|