I think you're trying to remember,

my $operator = '> 98.0'; if ( eval $consumption . $operator ) { }
I think that absorbing the operator into a string to be eval'd doesn't get you anything you want. I'd prefer,
sub LIMIT () { 98.0 } if ($consumption > LIMIT) { }

After Compline,
Zaxo


In reply to Re: Using dynamic operators in an if() statement by Zaxo
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":