Perl Monk, Perl Meditation | |
PerlMonks |
Re: Question about ternary conditionby dave_the_m (Monsignor) |
on Jun 28, 2005 at 09:46 UTC ( [id://470547]=note: print w/replies, xml ) | Need Help?? |
Prececedence:
is parsed as and if cond is true, gets reduced to so you assign OK, then KO, to $result. In any case, your first syntax is preferable, and the use of exists is unnecessary as the only keys you're testing are the the keys of the hash, so they must always exist Dave.
In Section
Seekers of Perl Wisdom
|
|