I often use tri-state flags, with possible value true (1), false (0), or
undetermined (undef).

The question is: how do you test for one of the flags, in particular for
0, without warnings?

For true, it's easy:

        $flag

For undef, it's not hard:

        !defined $flag

But for 0?

Note that "$flag" may well be an expression, so repetition as in the
next, is not good:

        defined $flag && !$flag

So, who does better?

-- 
        Bart.

Reply via email to