in reply to Is this reliable?
My preference is to use the ternary operator (like others have shown) if you are setting $r once, but if I were updating $r in a loop, for example, based on the value of $temp, I'd probably just go with this:
$r += 250 if $temp > 100;
I find it very readable.
|
---|
In Section
Seekers of Perl Wisdom