Yes that works – I knew it does – but I was wondering why doing it this way caused such strange output...
I've given thought to operator precedence, but I figured things wouldn't align up and I'd get a warning or error.
So how would this get parsed? Something like the following I presume:
(defined($var) ? $var) .= ('y' : $var .= 'n') if $el eq 'apple';
Thanks for the explanation, operator precedence makes a lot more sense now. I'm just surprised things lined up well enough not to cause any warnings or syntax errors.