From: Jeff King Date: Sun, 03 May 2009 20:31:26 GMT Subject: Re: [PATCH 4/6] Add explict return to end of subroutines Message-ID: <20090503203126.GE20468@coredump.intra.peff.net> In-Reply-To: <1241010743-7020-5-git-send-email-wfp5p@virginia.edu> 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