On Fri, Jul 8, 2011 at 1:12 AM, l.mai@web.de <perlbug-followup@perl.org>wrote: > # New Ticket Created by l.mai@web.de > # Please include the string: [perl #94350] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=94350 > > > > > This is a bug report for perl from l.mai@web.de, > generated with the help of perlbug 1.39 running under perl 5.14.1. > > > ----------------------------------------------------------------- > [Please describe your issue here] > > So I was looking for the official definition of "truth" in the perldocs. > > perldata says: > > | A scalar value is interpreted as TRUE in the Boolean sense if it is not > | the null string or the number 0 (or its string equivalent, "0"). > > perlsyn says: > > | The number 0, the strings C<'0'> and C<''>, the empty list C<()>, and > | C<undef> are all false in a boolean context. All other values are true. > The most concise and accurate definition I've come across is: Anything that stringifies to "" or "0" is a false value This definition covers objects with overrides. Examples can be appended. > perlsyn claims the empty list is false, which doesn't even make sense. > There are no lists in > scalar context. There's no such thing as a list *value* in scalar context, but the list *operator* can definitely be used in scalar context. my $x = (1,2,3); Booleans are scalars. Therefore you can't have an "empty list" > in boolean context (C<()> simply evaluates to C<undef> but I don't know if > that's documented anywhere). > True, "()" evaluates to undef. But that's false, so what's the issue? - EricThread Previous | Thread Next