in reply to Re^2: Question about ternary operator
in thread Question about ternary operator
# bad: ternary in void context: exists($checked->{Group}{$GroupDN}) ? ($rc_OK=1) : ($rc_OK=check_group +($GroupDN,0)); # good: 'if' in void context: if (exists($checked->{Group}{$GroupDN})) { $rc_OK = 1 } else { $rc_OK=check_group($GroupDN,0) } # also good: ternary in scalar context: $rc_OK = exists($checked->{Group}{$GroupDN}) ? 1 : check_group($Group +DN,0)
So you have two good, idiomatic ways to express something, and complain that the third is a PITA?
|
|---|