in reply to Using dynamic operators in an if() statement
I think you're trying to remember,
I think that absorbing the operator into a string to be eval'd doesn't get you anything you want. I'd prefer,my $operator = '> 98.0'; if ( eval $consumption . $operator ) { }
sub LIMIT () { 98.0 } if ($consumption > LIMIT) { }
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using dynamic operators in an if() statement
by ikegami (Patriarch) on Aug 22, 2006 at 05:31 UTC |