Front page | perl.fwp |
Postings from December 2001
Re: tri-state flags
Thread Previous
|
Thread Next
From:
Philip Newton
Date:
December 6, 2001 11:27
Subject:
Re: tri-state flags
Message ID:
sohv0uc3of9s9b5dp41fsu9go6aa94ja5n@4ax.com
On Thu, 06 Dec 2001 13:46:41 +0100, bart.lateur@pandora.be (Bart Lateur)
wrote:
> Also intersting to note is its behaviour WRT perl booleans. As you know,
> (or should know ;-)), is that these have a dual nature: a boolean false
> is 0 in numerical context, and "" in string context. Well, apparently ~
> thinks of it as a number.
I suppose it depends on the order in which the appropriate code behind
the ~ operator tests -- if it's "if(num) {...} elsif(string) {...}"
you'll obviously get diffferent results than from "if(string) {...}
elsif(num) {...}" for variables which have both the "is-num" and
"is-string" bit turned on.
Cheers,
Philip
Thread Previous
|
Thread Next