if ( $b and $c ) { $string = "$a where $b and $c"; } elsif ( $b or $c ) { $string = "$a where " . ($b ? $b : $c) ; } #### $x = $b ? 5 : 17;