in reply to Re: exiting a if loop
in thread exiting a if loop

Ah! A foul use of the beloved ternary test! 1 Don't put the lvalue in their twice. Do this instead: 2

$check = $HOLIDAY || $time<=1800 ? "TRUE" : "FALSE";

[1] TIMTOWTDI, of course, I'm not saying it's "wrong", just inelegant :)

[2] Note that the use of "or" instead of "||" would be wrong in this case, as ternary is higher than "or", but lower than "||", in precedence.

Replies are listed 'Best First'.
RE: RE: Re: exiting a if loop
by buzzcutbuddha (Chaplain) on Jun 06, 2000 at 22:11 UTC
    I concede that I did not make the best use of the ternary operator. oh well. now I know better.
    thanks for the tip Turnstep.