in reply to What could make "()" a good value for boolean false?

> I am a bit baffled as to why "()" should make a better false value as say "undef"

sub tst { return undef } means returning a one element list in list context.

so @a = tst() is true in if(@a) {..} (length is one)

FWIW for me a blank return; is best for false. (i.e. returning an empty list implicitely )

And the empty list evaluates to undef again in scalar context.

update

I've been a bit sloppy in my wording, Perl doesn't return a list!

The return statement is evaluated in the call context (one of the weirdnesses which were adressed in Perl6).

But this is not relevant when retuning just one undef.

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!