more useful options | |
PerlMonks |
Re: ternary conditional helpby haukex (Archbishop) |
on Nov 28, 2016 at 20:42 UTC ( [id://1176733]=note: print w/replies, xml ) | Need Help?? |
Hi opaltoot, tybalt89 already gave you the answer, I just wanted to note you can use B::Deparse to see how Perl interprets your code for yourself (I replaced 1 with $x to prevent optimization):
See also Operator Precedence and Associativity. Although you might want to consider if using the ternary operator like that will help the legibility of the code :-) Hope this helps,
In Section
Seekers of Perl Wisdom
|
|