in reply to Re: What are all the false values in Perl ((conditional
in thread What are all the false values in Perl ((conditional, boolean, whitespace, unprintable characters)
Your list statement is incorrect:
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;
EDIT
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... :-)
In Section
Seekers of Perl Wisdom