in reply to Truth and Falsehood
The empty list (), which evaluates to undef.
When's the last time you did if (()) {}? Why would you ever do that?
I suppose one could use sub f { return (); } if (f()) {}, but that's a very bad practice. (A sub that's expected to return a scalar should do so even in list context.)
So I'm rather baffled as to why this was mentioned. There are so many operators that can return false that would merit a mention before (), such as scalar assignment, list assignment, grep, map, m// and s///.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Truth and Falsehood
by haukex (Archbishop) on Aug 18, 2019 at 07:04 UTC | |
Re^2: Truth and Falsehood
by jcb (Parson) on Aug 18, 2019 at 07:13 UTC | |
by ikegami (Patriarch) on Aug 30, 2019 at 16:31 UTC |