For a less esoteric example:
$apples=3; $oranges=1; print "I have $apples ", $apples==1?"apple":"apples", "\n"; print "I have $oranges orange", $oranges==1?"":"s", "\n"; __END__ I have 3 apples I have 1 orange
--
Tommy
Too stupid to live.
Too stubborn to die.
In reply to Re: ternary operator ?
by tommyw
in thread ternary operator ?
by sulfericacid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |