$var .= (defined($var) ? 'y' : 'n';
See also Confused by Perl ternary operator, perlop.
In reply to Re: strange output from conditional operator
by moritz
in thread strange output from conditional operator
by december
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |