On Wed, Apr 29, 2009 at 09:12:21AM -0400, Bill Pemberton wrote:
In perl a subroutine that ends without an explicit return will return
the value of the last expression evalutated. This can lead to
unexpected return values.
I am not opposed to this, but it is really not helping anything. These
functions aren't meant to return any value, and their return values are
not used. In C, they would simply be declared "void", but there is no
way (AFAIK) to do that in perl.
But for some of them, I wonder if you would do better instead of
returning _nothing_ to return something that might make a little bit of
sense. For example, make_message_id munges a global variable. A
useful refactoring might be to have it return the value of the
global variable, and then perhaps even the global could go away, which
_would_ be a real improvement.
-Peff