laziness, impatience, and hubris | |
PerlMonks |
Re: Useless <c>unless</c>by davidrw (Prior) |
on Aug 05, 2005 at 22:07 UTC ( [id://481378]=note: print w/replies, xml ) | Need Help?? |
doesn't the ternary operator accomplish this already with b ? a : c; ? (And second example is just (my $o = b) ? a : b;) Do you have any examples of uses of unless that have created traps? For better or for worse, I personally actually use ! $x, !$x, and unless $x ... depends on how it reads in context, and how it fits in the coding style of whatever code i'm modifying.. Update: First one could also be: (b && a) || c; But it requires that a only ever return a true value.
In Section
Meditations
|
|