in reply to Re^2: Truth and Falsehood
in thread Truth and Falsehood

I see - thank you. Interestingly the very next sentence in perldata is:

A more precise definition is version dependent.

which suggests that there may be some versions out there where the false value returned is not zero (or that there may be in future, intriguingly). I'll have to try to remember only to test the truth of empty hashes rather than their numerical value. :-)

Replies are listed 'Best First'.
Re^4: Truth and Falsehood
by haukex (Archbishop) on Aug 17, 2019 at 10:30 UTC
    A more precise definition is version dependent. which suggests that there may be some versions out there where the false value returned is not zero

    That sentence was introduced along with the change that scalar(%hash) returns the same thing as 0+keys(%hash) instead of the bucket counts, so I suspect that's what it is referring to.

    But anyway, when the Perl documentation says "a false value" or "false", I don't make any assumptions of which of the possible false values it'll return :-)