Is there such a thing? The equivalent of a <= expr <= b, or in SQL parlance expr BETWEEN a AND b, where expr is evaluated only once
a <= expr <= b
expr BETWEEN a AND b
expr
I think this is your only bet.
$x = expr; if ($a < $x && $x < $b) { # stuff }