Why not simply:

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

DWIM is Perl's answer to Gödel

In reply to Re: Using dynamic operators in an if() statement by GrandFather
in thread Using dynamic operators in an if() statement by captkirk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":