in reply to Using dynamic operators in an if() statement

Why not simply:

... use constant THRESHOLD => 98.0; ... if ($consumption > THRESHOLD) { # do something }

DWIM is Perl's answer to Gödel