in reply to Re: strange output from conditional operator
in thread strange output from conditional operator
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: strange output from conditional operator
by moritz (Cardinal) on May 15, 2009 at 12:31 UTC | |
Re^3: strange output from conditional operator
by JadeNB (Chaplain) on May 15, 2009 at 21:53 UTC |
In Section
Seekers of Perl Wisdom