... has a value of NaN, which is false.
Ok, I'm confused. In your OP, you say NaNs are true. Now you're saying they're false.
Update: I see, you're talking about your overloaded version, which changes the "sign" of NaN.
Ok, I agree that changing that is a Bad Idea in general, because of the violation of expectations.
So, I guess you'll be stuck (assuming you ditch your overloaded version) doing an explicit test
for NaN...
if ( $obj == NaN or $obj ) # true if true or NaN
in which case, you could wrap it in a new method:
sub isTrue # !
{
my $obj = shift;
$obj == NaN || $obj
}
|