Otherwise you are right. The false scalars are:print "hello\n" unless (1, 0);
Truth is evaluated in void (essentially scalar) context so something that looks like a list (array, hash, etc) is coerced into a scalar before the boolean test.undef, '', '0', 0.0;
My bad for saying void when I meant Boolean.
But note that when I said "looks like a list" I used that phrase very, very carefully. Many list-like things exist in Perl, but there is no list per se. For an earlier post of mine on this exact topic try Arrays are not lists.
I would give an array slice example, but tye gave a better one than the one I was going to do... :-)
|Replies are listed 'Best First'.|
RE: RE (tilly) 2: What are all the false values in Perl ((conditional
by dchetlin (Friar) on Sep 23, 2000 at 00:31 UTC
by Adam (Vicar) on Sep 23, 2000 at 01:13 UTC