> > For everyone else, putting in an explicit `return` is a way to > > state explicitly that âyes, I really did mean for this value to > > be returned, I did not just forget to suppress it.â > > > > See above. There are alternative ways to do this. I'll often do: > > sub NAME > { > ... declarations ... > > ... bodies ... > > $result; > } IMO the habbit to write sub foo { ... $bar; } is only syntax preference of writing sub foo { ... return $bar; } .. so I consider both to be exactly the same. On the contrary, if the following sub: sub foo { do_something_useful(); } ... happens to return something as a side effect, this is just a wasted CPU due to mis-optimization, (fortunately small mis-optimization) , which happens quite often (unfortunately) For sure 99,9% of people do not mean it as sub foo { return do_something_useful(); } and even if they do, this *is* a bat habbit because this is a potential pain for future readings of this code, either by author or maintainer. Just my RUR0.02 BR, Vadim.Thread Previous | Thread Next