Perl Monk, Perl Meditation | |
PerlMonks |
Re: Perl ternary operator styleby JavaFan (Canon) |
on May 29, 2011 at 17:12 UTC ( [id://907231]=note: print w/replies, xml ) | Need Help?? |
If you want X if X is true, otherwise Y, that operator is usually written ||. The only reason to use X ? X : Y instead is when you want to evaluate X twice. But that's not what you want according to your description. So:
In Section
Seekers of Perl Wisdom
|
|