Empty Hash Values
Dave Hodgkinson
davehodg at gmail.com
Tue Apr 14 21:25:12 BST 2009
On 14 Apr 2009, at 18:16, Matt Lawrence wrote:
> Jasper wrote:
>> Adrian and I had a tiny chat about this in work, and he decided that
>> subs that return a scalar should return undef explicitly (if they are
>> just returning), and those that return a list should return.
>>
>> At the time I thought it seemed very sensible, but I'm on the fence
>> again.
>>
>> Difficult to retroactively enforce, at any rate.
>>
> Most of the time just returning does what you expect, it's false in
> every context and undef in scalar context.
And fails PBP for exactly the confusion in previous mails. Plain
return is Just Wrong. Be explicit.
--
Dave Hodgkinson MSN: davehodg at hotmail.com
Site: http://www.davehodgkinson.com UK: +44 7768 490620
Blog: http://davehodg.blogspot.com
Photos: http://www.flickr.com/photos/davehodg
More information about the london.pm
mailing list