Empty Hash Values

Tomas Doran bobtfish at bobtfish.net
Tue Apr 14 22:05:50 BST 2009


On 14 Apr 2009, at 21:25, Dave Hodgkinson wrote:
> And fails PBP for exactly the confusion in previous mails. Plain
> return is Just Wrong. Be explicit.

By 'fails PBP', I assume you mean is wrong according to the book. If  
so, which copy of PBP are you reading?

My copy of PBP (pages 199-201) covers how you should always just  
'return', due to the fact return undef does the wrong thing if you say:

use Test::More tests => 1;
sub myfunc { return undef }

my @answer = myfunc();
ok !@answer;

Cheers
t0m


More information about the london.pm mailing list