in reply to RE (tilly) 2: What are all the false values in Perl ((conditional
in thread What are all the false values in Perl ((conditional, boolean, whitespace, unprintable characters)
That's not a list, that's the binary comma operator. Any non-empty list is true. It may look like a list, but it's not one.
UPDATE:
Hmm, "Any non-empty list is true" was a dumb thing to say, as tye and tilly pointed out.
It reminds me of an MJD quote:
"If there is a giant purple water buffalo returned from a function, then $h = func() will always give you the length of its nose."
In other words, any non-empty list is true because you never have a list in boolean context.
However, I do stand by my first and third sentences in the original post. I think it's misleading to say if (1,0) or even if @array[0,2,1] is a list.
It is, obviously, a complicated topic.
|
---|
Replies are listed 'Best First'. | |
---|---|
(tye)RE: What are all the false values in Perl
by tye (Sage) on Sep 23, 2000 at 00:55 UTC | |
by Adam (Vicar) on Sep 23, 2000 at 01:13 UTC | |
by tye (Sage) on Sep 23, 2000 at 01:20 UTC | |
by tilly (Archbishop) on Sep 23, 2000 at 01:53 UTC |
In Section
Seekers of Perl Wisdom